Exemple #1
0
        void AggregateByRange()
        {
            var keys = new string[] { "<4", "4-8", ">8" };

            for (int i = 0; i < 3; i++)
            {
                var ds = new DataSeries()
                {
                    ItemsSource            = SampleItem.CreateSampleData(100),
                    ValueBinding           = new Binding("Value"),
                    Aggregate              = Aggregate.Count,
                    Label                  = "Sample Group " + (i + 1).ToString(),
                    AggregateGroupSelector = RangeSelector
                };
                chart.Data.Children.Add(ds);
            }

            chart.Data.ItemNames = keys;

            // style chart
            chart.View.AxisY.MajorTickThickness = 0;
            chart.View.AxisY.MinorTickThickness = 0;
            chart.View.AxisY.AxisLine           = new Line()
            {
                StrokeThickness = 0
            };
            chart.View.AxisX.MajorGridStrokeThickness = 0;
            chart.View.AxisX.MinorGridStrokeThickness = 0;
            chart.View.AxisX.MajorTickThickness       = 0;
            chart.View.AxisX.MinorTickThickness       = 0;
        }
 void CreateNewDataSeries()
 {
     for (int i = 0; i < 2; i++)
     {
         var ds = new DataSeries()
         {
             ItemsSource          = SampleItem.CreateSampleData(40),
             ValueBinding         = new Binding("Value"),
             PointTooltipTemplate = this.Resources["lbl"] as DataTemplate,
             Label = "s" + i
         };
         chart.Data.Children.Add(ds);
     }
 }