Fires just before the chart image is drawn. Use this event to customize the chart picture.
Visual Basic (Declaration) | |
---|---|
Public Event Customize() As CustomizeEventHandler |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public event CustomizeEventHandler Customize() |
The following sample increases the Maximum and Minimum properties of the primary X-axis scale. The maximum is increased by 1 and the minimum is decreased by 1.
Visual Basic | Copy Code |
---|---|
Imports Dundas.Charting.WebControl<CRLF>...<CRLF><CRLF>' Customize event handler<CRLF>Private Sub Chart1_Customize(ByVal chart As Chart) Handles Chart1.Customize<CRLF> <CRLF> ' adjust X axis scale<CRLF> Chart1.ChartAreas("Default").AxisX.Maximum += 1.0<CRLF> Chart1.ChartAreas("Default").AxisX.Minimum -= 1.0<CRLF><CRLF> 'call the ReCalc method to recalculate the ChartArea object<CRLF> Chart1.ChartAreas("Default").ReCalc()<CRLF><CRLF>End Sub |
This event has two unique features that other events do not have:
- All chart data is available (i.e. the series and their data points are populated). This is especially useful if data-binding is being used, since the data can be examined and the chart can be adjusted just prior to being drawn.
- All chart properties have been set, including those properties that have been set to "Auto". In other words, "Auto" properties now store the automatically calculated values, and can be examined and modified prior to the chart being drawn (e.g. the axis Minimum and Maximum properties).
Use this event to modify the chart before it is drawn.
When changes are made to a chart area (e.g. an axis scale, etc.) then the chart area properties must be recalculated so that the chart is rendered correctly. To recalculate the chart call the ReCalc method after making modifications.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family