Select (Dundas Chart Server Control 1.0)

From Dundas

Select

Overview | Properties | Methods

Call this method so that you can utilize the GetSelectedPosition and GetSelectedSeries methods when working with a server-side chart imagemap (i.e. implementing drilldown and/or selection).

Syntax

long = PieChartObject. Select(X As Long, Y As Long, Width As Long, Height As Long)

The Select method syntax has the following parts:

Part

Description

X

The X-coordinate of the mouse position where the user clicked. Use the querystring's first number (from the imagemap) for this argument.

Y

The Y-coordinate of the mouse position where the user clicked. Use the resulting querystring's second number for this argument.

Width

The height of the jpeg image (as set in the SendJPEG() call).

Height

The width of the jpeg image (as set in the SendJPEG() call).

long

Returns a long indicating the success or failure of the operation. Zero (0) is returned if successful, otherwise a non-zero value is returned.

  Returns

A long which indicates the success/failure of the operation. Zero (0) is returned if successful, otherwise a non-zero value is returned. If an error occurs use this return value as the argument for GetErrorText in order to retrieve a relevant text error message.

Remarks

Call this method in a page which is loaded as a result of a server-side chart imagemap being clicked on in order to find out which data element was selected. This method is used when working with a drill-down type of scenario.

To set the X and Y arguments you will need to parse the passed querystring item (the mouse position with a syntax of "201,75") which results from the IsMap attribute within the <IMG> tag. To parse this data () use the InStr VBScript function. The first number in the querystring will be the mouse' X-coordinate, while the second querystring value is the corresponding mouse' Y-coordinate.

IMPORTANT: Even though the page which handles the selection does not output a jpeg we MUST reproduce the exact same chart which is created by the page within the <IMG> tag (the page which outputs the jpeg via SendJPEG). In order to guarantee that the exact same chart is reproduced we highly recommend using a server-side include for the code which creates the chart (starting from the CreateObject call all the way to setting the Chart object to Nothing).

The height and width arguments should match those specified in the corresponding SendJPEG call as well as those which may have been specified as Height and Width attributes in the relevant <IMG> tag.

For sample source on this refer to the Tutorial: Drilldown and Selection of Data Elements. You can also examine the Selection, Grand Prix or Gross Domestic Product (Drilldown) samples which are distributed with the Chart Server Control for sample source code about the Select, GetSelectedPosition and GetSelectedSeries methods.

See Also: GetSelectedPosition | GetSelectedSeries | Tutorial: Drilldown and Selection of Data Elements