We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to set CustomPoints for the Chart ?

 

One can set the custom point by plotting points on the Chart Area even if they don't belong to a series. These are stored in the ChartControl.CustomPoints collection.They can be used for annotation of interesting data on the chart.

The ChartCustomPoint class can be used to set text, background, border or symbols at a particular point on the chart area.

One can exposed the Custom points in the following four categories,

  • PointFollow - This custom point will follow the regular points of any series, to which it is assigned.
  • ChartCoordinates - This lets you render a point type at any location in the chart.
  • Percent - The coordinates are specified as the percentage of the chart area.
  • Pixel - The coordinates are specified to be in pixels of the chart area.

C#

//Customize the Custom Point

ChartCustomPoint cp1=new ChartCustomPoint();

cp1.PointIndex = 0;

cp1.SeriesIndex = 1;

cp1.CustomType = ChartCustomPointType.PointFollow;

cp1.Text = "(Follows data point)";

cp1.Symbol.Shape = ChartSymbolShape.Circle;

// Adding PoinFollow type CustomPoint

this.chartControl1.CustomPoints.Add(cp1);

VB

'Customize the Custom Point

Dim cp1 As ChartCustomPoint = New ChartCustomPoint()

cp1.PointIndex = 0

cp1.SeriesIndex = 1

cp1.CustomType = ChartCustomPointType.PointFollow

cp1.Text = "(Follows data point)"

cp1.Symbol.Shape = ChartSymbolShape.Circle

' Adding PoinFollow type CustomPoint

Me.chartControl1.CustomPoints.Add(cp1)

Article ID: Published Date: Last Revised Date: Platform: Control:
72 04/30/2011 07/10/2014 Windows Forms Chart
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.