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

Line Chart Series Color, Legent Color Changing when we add Series Items at runtime

1 Answer 61 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Gopi
Top achievements
Rank 1
Gopi asked on 14 Dec 2012, 12:18 PM
Hi Team,

we are using the RadChart control to display Line chart. The MVVM model used to bind the datasource to chart. We have defined the pallete brushes to Series, Legend colors. At run time only we are adding Items in datasource. When we add new series to datasource, the it is created with previous series item color (both legend and series) and the previous series item is getting a new color.

But this shouldn;t happen, once the series is created, it should not lose it's color (both Series, legend) till application is closed.

Actual Result :

1. Setting the Empty DataSource to the Grid (this time no data will be displayed to the chart)
2. Adding "Item1" to the datasource. A new series is created for "Item1" with Red Color say for an example. (Both Legend, and series holds Red).
3. After some time adding "Item2" to the datasource, this time "Item2" is getting the Red Color for both Legend and series and "Item1" is getting a new color.

Expected Result :
1. "Item 1" shold not lose its color "RED" till the application closed.
2. "Item 2" should be created with a new color in the Pallete ratherthan taking it from Previous.

Can you please provide some help on this to achieve the expected result ?

Thanks in Advance.

Regards,
Gopi V

1 Answer, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 19 Dec 2012, 12:03 PM
Hi Gopi,

I made small project in order to reproduce the issue, but I couldn't. When a new Line Series is added, the previous one preserves its color, and the new one takes the next color from the palette. Note that the RadChart exposes the PaletteBrushesRepeat property, which by default is true. This means that when the number of series exceeds the number of user defined palette brushes, the coloring will start from the beginning of the palette brushes collection. If the property is set to false, the next colors will be taken from the theme palette.

I have attached the sample project for reference.
 
Regards,
Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Gopi
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Share this question
or