Skip to main content
A newer version of this page is available. .

How to: Custom Draw Series Points

  • 7 minutes to read

This example demonstrates one of several possible ways of using the ChartControl.CustomDrawSeriesPoint event. In the sample, the event is used to draw a custom legend markers of series points.

A custom legend marker is set to the CustomDrawSeriesEventArgsBase.LegendMarkerImage property. Note that in this case, the CustomDrawSeriesEventArgsBase.DisposeLegendMarkerImage property should be set to true to avoid memory leaks.

To customize options used to draw the series point, cast CustomDrawSeriesEventArgsBase.SeriesDrawOptions to the DrawOptions class descendant that stores draw options of the required series view type.

namespace CustomSeriesPointDrawingSample.Model {
    using System.Data.Entity;

    public partial class NwindDbContext : DbContext {
        public NwindDbContext()
            : base("name=NwindDbContext") {
        }

        public virtual DbSet<Employee> Employees { get; set; }
        public virtual DbSet<Order> Orders { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder) {
        }
    }
}
See Also