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

Combo bar/line chart - how to align line points with the left side of the bar? #9852

Closed
cintiapinto opened this issue Nov 15, 2021 Discussed in #9788 · 1 comment
Closed

Comments

@cintiapinto
Copy link

Discussed in #9788

Originally posted by cintiapinto October 25, 2021
I have a combo bar/line chart where the line dataset starts straight after the bar dataset on the x-axis.

i.e.

  • from 0 to 2020 -> bar chart
  • 2020 to 2050 -> line chart

I have put in null values in my data array for the line chart, so it starts at the right x position. However, it seems like on bar/line combo charts, a point in the line is always centred in the middle of the bar category.

This can also be seen in the samples:
https://www.chartjs.org/docs/latest/samples/other-charts/combo-bar-line.html

Screen Shot 2021-10-25 at 10 33 04 am

This is causing a "gap" in between my two datasets because the point is positioned in the middle:

Screen Shot 2021-10-21 at 12 02 30 pm

Is there a way to maybe sex an offset on the line chart dataset or an option to align the points to the left of the bar category?

I need the behaviour of the normal line chart in the combo bar/line chart, where the point is at the start of the category
e.g.
Screen Shot 2021-10-25 at 10 34 44 am

(screenshot from docs https://www.chartjs.org/docs/latest/samples/line/line.html)

Thank you!

@LeeLenaleee
Copy link
Collaborator

Should remain a discussion where it came from

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

No branches or pull requests

2 participants