usmanali
Posts: 5
Joined: Mon Sep 11, 2023 3:12 pm

[Yesterday 9:03 PM] Ali, Usman The x-axis values in the column chart are not accurately plotted.

Hello There,

In spite of using the "pointPlacement": "between" tag, we are having trouble getting the bars on the column chart to plot in between the numbers on the x-axis.

please check on this demo link:
https://codepen.io/usman555/pen/MWZmKpb
jedrzej.r
Posts: 700
Joined: Tue Jan 24, 2023 11:21 am

Re: [Yesterday 9:03 PM] Ali, Usman The x-axis values in the column chart are not accurately plotted.

Hi!

Welcome to our forum and thanks for reaching out to us with your question!

You can also manipulate pointPlacement by setting its' value as a number, which allows you to get desired results. Take a glance at below example.

Demo: https://jsfiddle.net/BlackLabel/4auowpn1/

API: https://api.highcharts.com/highcharts/s ... tPlacement

Let me know if that was what you were looking for!
Best regards!
Jędrzej Ruta
Highcharts Developer
usmanali
Posts: 5
Joined: Mon Sep 11, 2023 3:12 pm

Re: [Yesterday 9:03 PM] Ali, Usman The x-axis values in the column chart are not accurately plotted.

Hi

Although "pointPlacement = 1" has already been attempted, the results are inconsistent.

Please check out the demo link below:
https://codepen.io/usman555/pen/MWZmKpb
jedrzej.r
Posts: 700
Joined: Tue Jan 24, 2023 11:21 am

Re: [Yesterday 9:03 PM] Ali, Usman The x-axis values in the column chart are not accurately plotted.

I see, since you've set the pointRange property to a fixed value, you'd have to adjust the pointPlacement value until you reach desired result. If you set the xAxis.tickLength value to a number bigger than 0, it would be easier to see if the columns are plotting exactly between ticks.

Demo: https://jsfiddle.net/BlackLabel/ko283790/

Let me know if you have any further questions!
Best regards!
Jędrzej Ruta
Highcharts Developer
usmanali
Posts: 5
Joined: Mon Sep 11, 2023 3:12 pm

Re: [Yesterday 9:03 PM] Ali, Usman The x-axis values in the column chart are not accurately plotted.

Therefore, in our situation, we are not setting the pointRange property to a fixed value, rather, we are setting it to a dynamic value. If we manually set the pointplacement value, however, it will still function, but we want any property that sets values for us consistently. What would be the deciding factor for pointplacement?
jedrzej.r
Posts: 700
Joined: Tue Jan 24, 2023 11:21 am

Re: [Yesterday 9:03 PM] Ali, Usman The x-axis values in the column chart are not accurately plotted.

Unfortunately, I'm afraid it's not possible since pointPlacement is strictly related to each series pointRange, so the pointPlacement value has to be adjusted according to acutal pointRange. You can take a glance at the code responsible for translating pointPlacement values into x-axis: https://github.com/highcharts/highchart ... 3615-L3637

Let me know if you have any further questions!
Best regards!
Jędrzej Ruta
Highcharts Developer

Return to “Highcharts Stock”