Format LabelAppearance

Thread is closed for posting
2 posts, 0 answers
  1. Daniel
    Daniel avatar
    184 posts
    Member since:
    Feb 2009

    Posted 27 Jul 2009 Link to this post

    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.
  2. Daniel
    Daniel avatar
    184 posts
    Member since:
    Feb 2009

    Posted 27 Jul 2009 Link to this post

    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.
Back to Top