This is a migrated thread and some comments may be shown as answers.

Different colors for different points in areaseries

5 Answers 129 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Gitle
Top achievements
Rank 1
Gitle asked on 05 Oct 2018, 11:37 AM

I have a chart with an AreaSeries and a DateTime horizontal axis. I want to set a different color on certain points in the series, so that it looks for example like this: https://i.imgur.com/yycLv4v.png

How can I achieve this? 

5 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 05 Oct 2018, 01:59 PM
Hello Gitle,

The chart line and area series doesn't support different color of parts of the area (or the line). In order to achieve similar visualization you can use the PlotBand annotation of the chart and place it over the area which you want to be colored. Can you please try this and let me know if it helps?

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Gitle
Top achievements
Rank 1
answered on 08 Oct 2018, 06:51 AM
I would need the colored area to be clipped by the seriesarea so that only the data is colored, not the whole axis. Is that possible with annotations?
0
Accepted
Martin Ivanov
Telerik team
answered on 10 Oct 2018, 08:12 AM
Hello Gitle,

The closest effect that you can achieve with an annotation is to use the MarkedZone annotation instead of the PlotBand. This way you can draw a rectangle over the area. 

Another approach would be to use an additional area series that you can display on the highlighted area. You can color the additional series with another brush. You will need to have a new series for each area you want to highlight.

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Gitle
Top achievements
Rank 1
answered on 10 Oct 2018, 10:58 AM
For the record I found a way to do it with the plotband annotations, by setting the Clip property of the plotband to the RenderedGeometry of the Path object of the areaseries, which I found by parsing through the children of the chart until I found the path. 
0
Martin Ivanov
Telerik team
answered on 11 Oct 2018, 08:15 AM
Hello Gitle,

I am glad to hear that you managed to achieve your requirement. 

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ChartView
Asked by
Gitle
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Gitle
Top achievements
Rank 1
Share this question
or