Beispiel #1
0
        private void ShowChart()
        {
            // Now update the observable collection.
            if (this.IsVisible && chartDirty)
            {
                chartDirty = false;

                ChartDataSeries series = new ChartDataSeries()
                {
                    Name = CategoryType.ToString()
                };

                foreach (CategoryData item in from c in map.Values orderby c.Total descending select c)
                {
                    series.Values.Add(new ChartDataValue()
                    {
                        Label = item.Name, Value = item.Total, Color = item.Color, UserData = item
                    });
                }

                TotalAmount.Text  = string.Format("{0:C2}", Math.Abs(NetAmount));
                PieChart.Series   = series;
                Legend.DataSeries = series;
            }
        }
Beispiel #2
0
 public ChartDataSeries InsertSeries(int i, ChartDataSeries s)
 {
     if (i >= allSeries.Count)
     {
         allSeries.Add(s);
     }
     else
     {
         allSeries.Insert(i, s);
     }
     return(s);
 }
Beispiel #3
0
 public ChartDataSeries AddSeries(ChartDataSeries s)
 {
     return(InsertSeries(allSeries.Count, s));
 }