Exemplo n.º 1
0
        private void draw()
        {
            SolidColorBrush[] brushesArray = new SolidColorBrush[]
            {
                pBrushes.Blue,
                pBrushes.Red,
                pBrushes.Lime,
                pBrushes.Purple,
                pBrushes.SkyBlue,
                pBrushes.Orange
            };

            int k = 0;

            foreach (var kvp in nbEtudiantFiliere)
            {
                BarSeries3D      bar         = new BarSeries3D();
                SeriesPoint      seriesPoint = new SeriesPoint();
                CustomLegendItem legendItem  = new CustomLegendItem();

                seriesPoint.Argument = kvp.Key;
                seriesPoint.Value    = kvp.Value;

                bar.Points.Add(seriesPoint);
                bar.LabelsVisibility = true;

                legendItem.Text        = kvp.Key;
                legendItem.MarkerBrush = brushesArray[k];
                k++;


                this.Diagram3D.Series.Add(bar);
                this.legend1.CustomItems.Add(legendItem);
            }
        }
Exemplo n.º 2
0
        private void seriesCollection_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var            combo     = sender as ComboBox;
            ZAxisViewModel viewModel = new ZAxisViewModel();

            if (combo.SelectedIndex == 0)
            {
                Chart3D.Series.Clear();
                ColumnSeries3D series = new ColumnSeries3D();
                series.ShowTooltip  = true;
                series.Palette      = ChartColorPalette.Custom;
                series.ColorModel   = grid.Resources["customBrush"] as ChartColorModel;
                series.ItemsSource  = viewModel.FruitDetails;
                series.XBindingPath = "FruitsName";
                series.YBindingPath = "Count";
                series.ZBindingPath = "Day";
                Chart3D.Series.Add(series);
            }
            else if (combo.SelectedIndex == 1)
            {
                Chart3D.Series.Clear();
                BarSeries3D series = new BarSeries3D();
                series.ShowTooltip  = true;
                series.Palette      = ChartColorPalette.Custom;
                series.ColorModel   = grid.Resources["customBrush"] as ChartColorModel;
                series.ItemsSource  = viewModel.FruitDetails;
                series.XBindingPath = "FruitsName";
                series.YBindingPath = "Count";
                series.ZBindingPath = "Day";
                Chart3D.Series.Add(series);
            }
            else if (combo.SelectedIndex == 2)
            {
                Chart3D.Series.Clear();
                ScatterSeries3D series = new ScatterSeries3D();
                series.ShowTooltip  = true;
                series.ColorModel   = grid.Resources["customBrush"] as ChartColorModel;
                series.Palette      = ChartColorPalette.Custom;
                series.ItemsSource  = viewModel.FruitDetails;
                series.XBindingPath = "FruitsName";
                series.YBindingPath = "Count";
                series.ZBindingPath = "Day";
                Chart3D.Series.Add(series);
            }
        }
Exemplo n.º 3
0
        private void fillingChart()
        {
            bar11.DataContext       = plotInfoSource.plotInfos(1);
            rectangleChart1.Palette = Chart3DPalettes.Material;
            SqlCommand    commande = new SqlCommand("Select Id_filiere From Filiere", con);
            SqlDataReader reader   = commande.ExecuteReader();

            int nbFiliere = 1;

            while (reader.Read())
            {
                nbFiliere = reader.GetInt32(0);
                BarSeries3D geneBar1 = new BarSeries3D();
                geneBar1.XValueBinding = bar11.XValueBinding;
                geneBar1.YValueBinding = bar11.YValueBinding;
                geneBar1.ZValueBinding = bar11.ZValueBinding;
                geneBar1.ItemsSource   = plotInfoSource.plotInfos(nbFiliere);
                rectangleChart1.Series.Add(geneBar1);
            }
            reader.Close();
        }