Dundas Chart for ASP.NET
Customize Event
See Also  Example Send comments on this topic.
Dundas.Charting.WebControl Namespace > Chart Class : Customize Event


This event fires just prior to the chart being drawn. All chart data is available and all chart properties have been set.
Fires just before the chart image is drawn. Use this event to customize the chart picture.

Syntax

Visual Basic (Declaration)  
Public Event Customize() As CustomizeEventHandler
Visual Basic (Usage) Copy Code
Dim instance As Chart
Dim handler As CustomizeEventHandler
 
AddHandler instance.Customize, handler
C#  
public event CustomizeEventHandler Customize()

Example

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

Remarks

This event has two unique features that other events do not have:

  1. 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.
  2. 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.

Requirements

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

See Also

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.