MSChart hide series

edited 4:43PM in FastReport .NET
Hello

I have a chart object with 2 series. I would like to hide one of the series based upon a report parameter. From what I read about the mschart object, this can be done by simply setting the series.enabled parameter.

When I attemp to set the following: mschart1.chart.series("xxx").enabled = false I do get an error. I can set the parameter in design-mode, which works fine, but does not solve my problem.

Thanks for your help.

Regards
Felix Huber

Comments

  • edited 4:43PM
    In the MS Chart control (which they bought from Dundas), I have three series that need to be plotted.

    Two of the series should have an entry in the Legend, but the third should not.

    I've tried these lines of code, but none work:

    Chart c = new Chart();
    ChartArea ca = c.ChartAreas.Add("main");
    Legend lg = c.Legends.Add("mainLegend");
    Series s1 = c.Series.Add("s1");
    Series s2 = c.Series.Add("s2");
    Series s3 = c.Series.Add("s3");

    // ... populate the 3 series with data...

    s1.Legend = "mainLegend";
    s2.Legend = "mainLegend";

    // I've tried these:
    s3.Legend = ""; // gives an error about a nonexistent legend named ''
    s3.LegendText = ""; // just shows "s3" in the legend

    How do I prevent the series from appearing in the legend?

    ____________________________________________________________________________
    runescape gold | rs gold

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.