Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed chart type bar/line : the dots are not centered in the bars #3465

Closed
Charles-BARDIN opened this issue Oct 13, 2016 · 7 comments
Closed

Comments

@Charles-BARDIN
Copy link

Hi,

Thanks a lot for your wonderful work with this library. I'm using it since a few weeks and love it !
However, I have an issue with mixed bar/line charts.

Expected Behavior

The bar chart and the dots of the line chart must be aligned : the dot on the line must be horizontally centered in the bar.

Current Behavior

The bars are on the right of the dot. It then feels like the abscissa is not the same.

Steps to Reproduce (for bugs)

Here is a JSFiddle reproducing the bug.

Context

I need a chart to display market trades. It should show the time of the trade on the x-axis, a line for the prices and bars to show the quantity traded.

Environment

  • Chart.js version: 2.2.2
  • Browser name and version: Chrome 53
@simonbrunel
Copy link
Member

Hi Charles, you need stacked: true on the x-axis in order to get elements horizontally aligned.

@Charles-BARDIN
Copy link
Author

@simonbrunel thanks a lot, it works perfectly !

@Charles-BARDIN
Copy link
Author

Demo updated. In case someone needs it :)

@rainerholzapfel
Copy link

Seems to be broken since 2.7.0

@simonbrunel
Copy link
Member

@rainerholzapfel what is broken? can you build a jsfiddle with 2.7.1?

@rainerholzapfel
Copy link

The dots are not centered in the bars since 2.7.0

I took the working demo from Charles-BARDIN and replaced the Chart.js version:

Working: Demo 2.3.0
Broken: Demo 2.7.1

@simonbrunel
Copy link
Member

That's a different issue but you right, it's kind of broken in 2.7.1 and should be fixed by #4994

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants