Shift vertical bars to the right. #10433
Unanswered
LechoDecho
asked this question in
Q&A
Replies: 1 comment 6 replies
-
Can't check it right now but they should be included in the meta of the dataset which you can get like this: chartInstance.getDatasetMeta(barChartDatasetIndex) And then if I'm not mistaken there is a |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm currently using the latest version of ChartJS ( 3.8.0 ).
I'm trying to plot a bar chart ( histogram ) with additional vertical lines.
Therefore i chose a linear x axis starting at 0 and ending at the maximum possible value for x.
To be able to share the same x axis between the bars and lines ill keep the scaling but change the tick size to the value interval of one bar.
e.g.:
Min Value : 0
Max Value: 100
Number of Values: 1000
Value interval: 10
xaxis Label should be then: [0,10,20,30,40,50,60,70,80,90,100]
When plotting the bar chart without an offset, then the bars will be centers around this labels. This is causing a wrong representation of those bar. (Please ignore the blue line )
One possible solution would be to shift every bar about the width of a single bar to the right side.
I'm trying to reach that with implementing an own plugin, but therefore i would need a way to access the x axis value of a given bar.
Thanks for help in advance!
Beta Was this translation helpful? Give feedback.
All reactions