Example #1
0
        private void barChart_CustomDrawSeriesPoint(object sender, CustomDrawSeriesPointEventArgs e)
        {
            BarDrawOptions barOptions = e.SeriesDrawOptions as BarDrawOptions;
            int            colorIndex = (int)e.SeriesPoint.Tag;

            barOptions.Color = paletteEntries[colorIndex].Color;
        }
        private void OnCustomDrawSeries(object sender, CustomDrawSeriesEventArgs e)
        {
            bool isSelected = e.Series.Name.Equals(trackedSeriesName);
            // Design a series marker image.
            Bitmap image = new Bitmap(totalWidth, totalHeight);

            using (Graphics graphics = Graphics.FromImage(image)) {
                using (var fillBrush = isSelected ? (Brush) new HatchBrush(HatchStyle.DarkDownwardDiagonal,
                                                                           e.LegendDrawOptions.Color,
                                                                           e.LegendDrawOptions.ActualColor2)
                                                  : (Brush) new SolidBrush(e.LegendDrawOptions.Color)) {
                    graphics.FillRectangle(fillBrush, totalRect);
                }
                Image photo;
                if (photoCache.TryGetValue(e.Series.Name, out photo))
                {
                    graphics.DrawImage(photo, photoRect);
                }
            }
            e.LegendMarkerImage        = image;
            e.DisposeLegendMarkerImage = true;

            BarDrawOptions options = e.SeriesDrawOptions as BarDrawOptions;

            if (options != null && isSelected)
            {
                options.FillStyle.FillMode = DevExpress.XtraCharts.FillMode.Hatch;
                ((HatchFillOptions)options.FillStyle.Options).HatchStyle = HatchStyle.DarkDownwardDiagonal;
            }
        }
Example #3
0
        private void chartControl1_CustomDrawSeriesPoint(object sender, DevExpress.XtraCharts.CustomDrawSeriesPointEventArgs e)
        {
            BarDrawOptions drawOptions = e.SeriesDrawOptions as BarDrawOptions;

            if (drawOptions == null)
            {
                return;
            }
            double val = e.SeriesPoint[0];

            if (val < 100)
            {
                drawOptions.Color = Color.Red;
            }
            else
            {
                drawOptions.Color = Color.LimeGreen;
            }
        }
Example #4
0
 public static void UpdateDrawOptions(BarDrawOptions options)
 {
     options.FillStyle.FillMode = FillMode.Hatch;
     options.Shadow.Color       = Color.Azure;
 }