RicardoP
Posts: 5
Joined: Tue Sep 20, 2022 7:07 am

HightCharts .NET wrapper changing the color of a DataPoint.

Hello, we are using HighCharts Wrapper for .NET

We can render the charts without any issues but now we want to change the color of specific points depending on a condition

Example if the value >50 the color will be green below 50 the color will be red

We are using LineSeriesData where we are passing the color (evaluated before with the condition) so we have many items of type LineSeriesData
with different colors in the collection but the line in the chart is not changing the color.

do you have an idea how to solve this issue? thank you
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: HightCharts .NET wrapper changing the color of a DataPoint.

Hi RicardoP!
Thanks for contacting us with your question!

It seems that your problem is easy to solve. I don't know where you are checking the conditions for color, but you should do it after the chart is loaded:

Code: Select all

Highsoft.Web.Mvc.Charts.ChartEvents.Load
API Reference: https://dotnet.highcharts.com/Help/High ... fb0636d0bf

Let me know if you have any further questions.
Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”