0

I'm new to charting in Silverlight 5. I created a chart in Silverlight with no 3rd party used. I added a series to a chart by code.

            ColumnSeries series = new ColumnSeries();
            PointCollection points = new PointCollection();
            points.Add(new Point(issue.immediate, issue.Sequence));

            series.ItemsSource = points;
            series.IndependentValueBinding = new System.Windows.Data.Binding("Y");
            series.DependentValueBinding = new System.Windows.Data.Binding("X");
            chart1.Series.Add(series);          

My problem is after using the chart1.Series.Clear(); command, the chart would be cleared. But when I put another Point Collection to the chart, the chart would include its previous set of column series. I'm expecting that the newly added series should be the fresh value of the chart. I've tried .Clear and .Remove methods of Series but nothing works.

  • How do you put another Point Collection to the chart? Add the code of that method to the question. – vortexwolf Apr 29 '13 at 17:08
  • @vorrtex: the points are added by this line chart1.Series.Add(series); – manuelbeltran8 May 02 '13 at 03:57
  • If you add another series by using the code in your question, you should call Series.Clear() before adding. You said that you tried this, but I don't see such method in your code. – vortexwolf May 02 '13 at 11:09

0 Answers0