travisrussi
Posts: 3
Joined: Thu Sep 02, 2021 7:04 pm

Set marker size/color per data point

Is it possible to use the data to determine the size and/or color of each marker when rendering a StockChart?

The Marker Only demo is the closest example I could find.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Set marker size/color per data point

Hello travisrussi,

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

Yes, it is possible to change marker's size and color per each data point. You need to use marker.radius and marker.fillColor
Demo: https://jsfiddle.net/BlackLabel/vz984fwa/
API reference:
https://api.highcharts.com/highstock/se ... ker.radius,
https://api.highcharts.com/highstock/se ... .fillColor

Let me know if that was what you were looking for!
Best regards!
Mateusz Bernacik
Highcharts Developer
travisrussi
Posts: 3
Joined: Thu Sep 02, 2021 7:04 pm

Re: Set marker size/color per data point

Thanks for the quick reply!

I didn't see any demo of it, but I saw in the docs that I could do a bubble series in a Stock Chart, so that's what I ended up doing.

https://api.highcharts.com/highstock/plotOptions.bubble
travisrussi
Posts: 3
Joined: Thu Sep 02, 2021 7:04 pm

Re: Set marker size/color per data point

Here's a demo using the Bubble chart type within a Stock Chart...

https://jsfiddle.net/travisrussi/r5d63b4a
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Set marker size/color per data point

Hello travisrussi,

Pretty clever, bubble series should be perfect in this case. Thank for sharing the demo with us!

In case of any further questions, feel free to contact us again.
Best regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Stock”