Пример #1
0
        public void ExecuteRecipe(Plot plt)
        {
            double[] values = { 778, 43, 283, 76, 184 };
            string[] labels = { "C#", "JAVA", "Python", "F#", "PHP" };

            // Language colors from https://github.com/ozh/github-colors
            Color[] sliceColors =
            {
                ColorTranslator.FromHtml("#178600"),
                ColorTranslator.FromHtml("#B07219"),
                ColorTranslator.FromHtml("#3572A5"),
                ColorTranslator.FromHtml("#B845FC"),
                ColorTranslator.FromHtml("#4F5D95"),
            };

            // Show labels using different transparencies
            Color[] labelColors =
                new Color[] {
                Color.FromArgb(255, Color.White),
                Color.FromArgb(100, Color.White),
                Color.FromArgb(250, Color.White),
                Color.FromArgb(150, Color.White),
                Color.FromArgb(200, Color.White),
            };

            var pie = plt.AddPie(values);

            pie.SliceLabels      = labels;
            pie.ShowLabels       = true;
            pie.SliceFillColors  = sliceColors;
            pie.SliceLabelColors = labelColors;
        }
Пример #2
0
        public void ExecuteRecipe(Plot plt)
        {
            double[] values = { 778, 43, 283, 76, 184 };
            var      pie    = plt.AddPie(values);

            pie.ShowValues = true;
        }
Пример #3
0
        public void ExecuteRecipe(Plot plt)
        {
            double[] values = { 778, 283, 184, 76, 43 };
            var      pie    = plt.AddPie(values);

            pie.Explode = true;
        }
Пример #4
0
        public void ExecuteRecipe(Plot plt)
        {
            double[] values = { 778, 43, 283, 76, 184 };
            string[] labels = { "C#", "JAVA", "Python", "F#", "PHP" };
            var      pie    = plt.AddPie(values);

            pie.SliceLabels = labels;
            plt.Legend();
        }
Пример #5
0
        public void ExecuteRecipe(Plot plt)
        {
            double[] values = { 778, 43, 283, 76, 184 };
            string[] labels = { "C#", "JAVA", "Python", "F#", "PHP" };
            var      pie    = plt.AddPie(values);

            pie.GroupNames = labels;
            pie.ShowLabels = true;
        }
Пример #6
0
        public void ExecuteRecipe(Plot plt)
        {
            double[] values     = { 779, 586 };
            string   centerText = $"{values[0] / values.Sum() * 100:00.0}%";
            Color    color1     = Color.FromArgb(255, 0, 150, 200);
            Color    color2     = Color.FromArgb(100, 0, 150, 200);

            var pie = plt.AddPie(values);

            pie.DonutSize        = .6;
            pie.DonutLabel       = centerText;
            pie.CenterFont.Color = color1;
            pie.OutlineSize      = 2;
            pie.SliceFillColors  = new Color[] { color1, color2 };
        }
Пример #7
0
        public void ExecuteRecipe(Plot plt)
        {
            double[] values = { 778, 43, 283, 76, 184 };
            string[] labels = { "C#", "JAVA", "Python", "F#", "PHP" };

            // modify labels to include a custom formatted value
            labels = Enumerable.Range(0, values.Length)
                     .Select(i => $"{labels[i]}\n({values[i]})")
                     .ToArray();

            var pie = plt.AddPie(values);

            pie.SliceLabels = labels;
            pie.ShowLabels  = true;
        }
Пример #8
0
        public void ExecuteRecipe(Plot plt)
        {
            double[] values = { 778, 43, 283, 76, 184 };
            string[] labels = { "C#", "JAVA", "Python", "F#", "PHP" };

            var pie = plt.AddPie(values);

            pie.HatchOptions = new HatchOptions[] {
                new () { Pattern = HatchStyle.StripedUpwardDiagonal, Color = Color.FromArgb(100, Color.Gray) },
                new () { Pattern = HatchStyle.StripedDownwardDiagonal, Color = Color.FromArgb(100, Color.Gray) },
                new () { Pattern = HatchStyle.LargeCheckerBoard, Color = Color.FromArgb(100, Color.Gray) },
                new () { Pattern = HatchStyle.SmallCheckerBoard, Color = Color.FromArgb(100, Color.Gray) },
                new () { Pattern = HatchStyle.LargeGrid, Color = Color.FromArgb(100, Color.Gray) },
            };
            pie.OutlineSize = 1;

            pie.SliceLabels = labels;
            plt.Legend();
        }
Пример #9
0
 public void ExecuteRecipe(Plot plt)
 {
     double[] values = { 778, 283, 184, 76, 43 };
     plt.AddPie(values);
 }