Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- settings.Name = "chart";
- settings.Width = 600;
- settings.Height = 250;
- settings.BorderOptions.Visible = false;
- Series series1 = new Series("Type", DevExpress.XtraCharts.ViewType.Pie3D);
- settings.Series.Add(series1);
- series1.ArgumentScaleType = ScaleType.Qualitative;
- series1.ArgumentDataMember = "ClassName";
- series1.ValueScaleType = ScaleType.Numerical;
- series1.ValueDataMembers.AddRange(new string[] { "PercentageValues" });
- series1.LegendPointOptions.PointView = PointView.ArgumentAndValues;
- series1.LegendPointOptions.ValueNumericOptions.Format = NumericFormat.Percent;
- series1.LegendPointOptions.ValueNumericOptions.Precision = 0;
- series1.Label.ResolveOverlappingMode = ResolveOverlappingMode.Default;
- series1.Label.Visible = false;
- settings.CustomDrawSeriesPoint = (s, ev) =>
- {
- BarDrawOptions drawOptions = ev.SeriesDrawOptions as BarDrawOptions;
- if (drawOptions == null)
- return;
- Color colorInTarget = Color.Blue;
- double x = ev.SeriesPoint.Values[0];
- double y = ev.SeriesPoint.Values[1];
- if (x == 0)
- { //Do starting
- colorInTarget = Color.FromArgb(159,125, 189);
- }
- else{
- //Red - price Increase
- // Green price Decrease
- if (y > previousYValue)
- {
- colorInTarget = Color.Red; ;
- }
- else
- {
- colorInTarget = Color.Green;
- }
- }
- previousYValue = y;
- drawOptions.Color = colorInTarget;
- drawOptions.FillStyle.FillMode = FillMode.Solid;
- drawOptions.Border.Color = Color.Transparent;
- };
- // Define the chart's appearance and palette.
- barChart.AppearanceName = "Dark";
- barChart.PaletteName = "Opulent";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement