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

Line Chart Color Changes not updating

4 Answers 120 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 10 Apr 2012, 08:22 PM
I have tried to set the changes to my line chart programatically.  This is the code I have edited inside of my .cs file.  I pushed through the changes, but nothing has shown up on my work.  I am guessing that these strings do not change the colors of the lines, then?


Telerik.Reporting.Charting.ChartSeries chartSeries1 = new Telerik.Reporting.Charting.ChartSeries();
Telerik.Reporting.Charting.ChartSeries chartSeries2 = new Telerik.Reporting.Charting.ChartSeries();
Telerik.Reporting.Charting.ChartSeries chartSeries3 = new Telerik.Reporting.Charting.ChartSeries();
Telerik.Reporting.Charting.ChartSeries chartSeries4 = new Telerik.Reporting.Charting.ChartSeries();
chartSeries1.Appearance.FillStyle.MainColor = System.Drawing.Color.Blue;
chartSeries2.Appearance.FillStyle.MainColor = System.Drawing.Color.Red;
chartSeries3.Appearance.FillStyle.MainColor = System.Drawing.Color.Green;
chartSeries4.Appearance.FillStyle.MainColor = System.Drawing.Color.Yellow;

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 11 Apr 2012, 10:06 AM
Hi Matt,

The colors would never be applied as you're setting them to new series items instead to the ones defined in your chart.
To apply color to your chart series items, you should access them accordingly e.g.:

this.chart1.Series[0].Items[0].Appearance.FillStyle.MainColor = System.Drawing.Color.Green;

Regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Matt
Top achievements
Rank 1
answered on 11 Apr 2012, 12:58 PM

This is the new snipet I created based off of your response.  The "Series1" is causing an error.  If I remove the "1" after Series, then "Items1" turns into an error.

 

 

 

this.chart2.Series1.Items1.Appearance.FillStyle.MainColor = System.Drawing.Color.Blue

0
Chris Gillies
Top achievements
Rank 1
answered on 11 Apr 2012, 01:12 PM
Matt, I get you're not a big fan of "find 10 differences" games? There is an obvious difference in your snippet compared to Teleriks and unfortunately the difference does not speak good about your dev skills.
0
Matt
Top achievements
Rank 1
answered on 11 Apr 2012, 01:23 PM
This is the point I have made.  I am not a developer.  I have no development skills what so ever.  Be that as it may, my PM is expecting me to be able to do these things, even after explaining to him that I do not have the necessary skill sets to do this.  So I am trying to get help wherever I can with this thing, as I am also not being allowed to get the necessary training to manipulate this program.
Tags
General Discussions
Asked by
Matt
Top achievements
Rank 1
Answers by
Steve
Telerik team
Matt
Top achievements
Rank 1
Chris Gillies
Top achievements
Rank 1
Share this question
or