ChartControl.CustomDrawSeriesPoint Event
Occurs before a series point is drawn, when the chart's content is being drawn.
Namespace: DevExpress.Xpf.Charts
Assembly: DevExpress.Xpf.Charts.v14.2.dll
#Declaration
#Event Data
The CustomDrawSeriesPoint event's handler receives an argument of the CustomDrawSeriesPointEventArgs type. The following properties provide information specific to this event:
Property | Description |
---|---|
Draw |
Gets the settings for custom drawing series of different types.
Inherited from Custom |
Handled |
Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.
Inherited from Routed |
Labels |
Gets the labels texts for the points currently being painted. |
Label |
Gets or sets the text of a label for the point currently being painted. |
Legend |
Gets or sets the Legend's text for the series whose points are currently being painted.
Inherited from Custom |
Original |
Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.
Inherited from Routed |
Routed |
Gets or sets the Routed |
Series |
Gets the series whose points are currently being painted.
Inherited from Custom |
Series |
Gets the series point currently being painted. |
Source |
Gets or sets a reference to the object that raised the event.
Inherited from Routed |
#Remarks
The CustomDrawSeriesPoint event is raised before every series point is painted. The event parameter's CustomDrawSeriesEventArgs.Series property provides the series whose specific series options are to be determined. The CustomDrawSeriesPointEventArgs.SeriesPoint property provides the series point which provides access to the data that corresponds to the series point being painted. And the CustomDrawSeriesEventArgs.DrawOptions property provides drawing options specific to each series.
The ChartControl.CustomDrawSeries and CustomDrawSeriesPoint events are always raised in the following order.
- The CustomDrawSeries event for the first series in the chart's Diagram.Series collection. The first series in the series collection is a Series for which the SeriesCollection.IndexOf method returns 0.
- The CustomDrawSeriesPoint event for all the series points of the first series.
- The CustomDrawSeries event for the second series in the chart's Diagram.Series collection.
- The CustomDrawSeriesPoint event for all series points of the second series.
- ...and so on, for all the other series and their points.
#Examples
This example shows how to change the color of each series point according to its values.
In addition, the point labels text is changed to show the color of the current interval (Green, Yellow, or Red).
To accomplish this, it is necessary to invoke the ChartControl.CustomDrawSeriesPoint event and change its drawing options in the CorrectDrawOptions() method.
In this example, you can deactivate the "Custom Draw" option on the stack panel to return to the default appearance of series points.