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

Format LabelAppearance

1 Answer 84 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Iron
Daniel asked on 28 Jul 2009, 12:47 AM
Hi. I use to have a RadChart that would appear on a masterpage. I now render the RadChart in a console application and save it to disk which works fine. The only thing is I can't seem to remove the label series or set the line series in the chart plot area. I think this is because unlike before, I haven't defined any ChartSeries items in my code behind. Here is my code:

ArrayList myList = new ArrayList();  
myList.Add(1);  
myList.Add(2);  
myList.Add(3);  
myList.Add(4);  
RadChart radChart = new RadChart();  
// Some formatting here  
radChart.DataSource = myList;  
radChart.DataBind();  
radChart.Save(@"c:\mychart.png", ImageFormat.Png); 

This work fine. The following code doesn't work because I have no ChartSeries items:

foreach (ChartSeries series in radChart.Series) {  
    series.Appearance.LabelAppearance.Visible = false;  
    series.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Black;  

Is there any way around this? If I try to use ChartSeries items it returns an error because I'm working with a console application.

1 Answer, 1 is accepted

Sort by
0
Daniel
Top achievements
Rank 1
Iron
answered on 28 Jul 2009, 01:22 AM
Gee I should really try a few things before I post. I found a work around for it. I can add a ChartSeries and ChartSeriesItem, my mistake.
Tags
Chart (Obsolete)
Asked by
Daniel
Top achievements
Rank 1
Iron
Answers by
Daniel
Top achievements
Rank 1
Iron
Share this question
or