My ChartView has series which are created dynamically (programmatically). Each of these series need to be a colour that is also only known at runtime. How do I go about doing this?
3 Answers, 1 is accepted
0
Accepted
Giuseppe
Telerik team
answered on 09 Dec 2011, 05:17 PM
Hi Kareema,
The easiest way to achieve the desired effect would be to set the BarSeries.DefaultVisualStyle property instead of defining custom DataTemplate through the BarSeries.PointTemplate property:
// the default visual element for bar item is Border.
Style barStyle = newStyle(typeof(Border));
Is there another way to specify the line/fill color? I have very similar problem, except the type of my series is also dynamic (stored as CartesianSeries), and setting the color of Border for LineSeries doesn't seem to change the line color.
Never mind, I realized that since I was saving it as CartesianSeries I didn't have access to fields such as Stroke. I am now simply checking for each type and casting it.
Edit: I got everything except for BarSeries fill working. How do you specify the color of the barseries?