Dukis
Posts: 6
Joined: Tue May 31, 2022 8:16 am

Create a highstock column chart

Hello Im trying to create a column stockChart with ajax.
For reference lets say something like this : https://jsfiddle.net/zosjbn2r/1/
Im getting some info from a database . the first time i get them like this :
a.png
a.png (45.48 KiB) Viewed 1257 times
.
When i update my chart it prints it out like this :
b.png
b.png (25.92 KiB) Viewed 1257 times
.
Basically instead of drawing each new line it sums up all the data values and puts them in one column. Is that a bug from using column on stockCharts? Because it works just fine in simple chart.
Also another thing . when you hover over in the jsfiddle chart from above you get all the column values. Is there a way to hide the xAxis value (Jan,Feb,etc) from that legend?
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Create a highstock column chart

Hi Dukis,

Thanks for contacting us with your question.

1) Please try to disable data grouping for column series:
https://api.highcharts.com/highstock/pl ... ng.enabled

2) Those values are shown in the header of the tooltip. To remove them you should edit headerFormat property:
https://jsfiddle.net/BlackLabel/0qkurp6s/

Let me know if it was what you were looking for.
Regards!
Mateusz Bernacik
Highcharts Developer
Dukis
Posts: 6
Joined: Tue May 31, 2022 8:16 am

Re: Create a highstock column chart

That worked out great only problem is when i update the chart it starts out zoomed in at the beginning of the chart and also basically zoom does not work . Chart is visible only when the zoom factor is at full width
b.png
b.png (17.61 KiB) Viewed 1247 times
.
It works flawless though on the first update , the problem arises on the 2nd time I update it
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Create a highstock column chart

Dukis,

Could you try to reproduce that issue in a live demo? You can start here: https://jsfiddle.net/BlackLabel/7y2t40fo/
I know that you use ajax but if that is more convenient for you feel free to hardcode that data.

Regards!
Mateusz Bernacik
Highcharts Developer
Dukis
Posts: 6
Joined: Tue May 31, 2022 8:16 am

Re: Create a highstock column chart

I've updated it : https://jsfiddle.net/v5shftb6/
I dont know if it will be any helpful but basically im setting the original chart then with ajax im fetchin up data put them in an array and update the chart. 2nd time i do the same i get the above result i showed you . Its not that it is not working .it is just that i have to zoom out the scrollbar at the bottom and zoom does not work its either full chart or nothing . I hope i explained it good enough for you to understand. again thx
Dukis
Posts: 6
Joined: Tue May 31, 2022 8:16 am

Re: Create a highstock column chart

Also kind of irrelevant but is there a way to add a fixed yCrosshair in the last elemtent of a stockChart?
I.E. https://jsfiddle.net/gh/get/library/pur ... basic-line. again thanks and sorry for the spam
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Create a highstock column chart

Hi Dukis,

It is hard to guess based on the description what is the cause on the issue. First of all I'd suggest you checking console for any errors. I suspect that the problem might be related to unsorted data. If the console will be clear, then I will need you to provide me with a sample of your data and I will try to recreate that issue.

When it comes to your second question, it sounds like price indicator. Please see the demo and let me know if it was what you were looking for:
https://jsfiddle.net/BlackLabel/vnx27g9z/

Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Stock”