ChartDirector 7.1 (.NET Edition)

WebChartViewer


The WebChartViewer control is a Web Forms control for viewing charts and for handling advanced chart user interactions. It is a subclass of the ASP.NET Image control.

WebChartViewer Features

The WebChartViewer control enhances the Image control in the following ways:

Special Considerations for Creating WebChartViewer Dynamically

Normally, controls are specified at design time by using ASP.NET tags, or by dragging and dropping the controls onto the Web Form in Visual Studio.

However, some applications may create controls dynamically on the fly during runtime (eg. during the Page Load event of the Web Form). In this case, the controls may not receive the "Page Init" event, as they are created after the event. The WebChartViewer requires this event for certain functions. If you are creating WebChartViewer on or after the Page Init event, please refer to WebChartViewer.OnPageInit on how to perform these functions in the Page Init event before the control is created.

WebChartViewer Output Methods

In addition to sending chart images directly from memory to the browser, WebChartViewer also supports storing the chart images as image files first, and sending the links to those files to the browser. Please refer to ASP.NET Output Methods with Viewers for additional information.

WebChartViewer Members

The followings list out the members that are specific to WebChartViewer. Members inherited from the Image control are omitted. Please refer to Microsoft .NET documentation for members of the Image control.

Properties
NameDescription
ImageRepresent the chart image to be viewed.
ImageMapGets or sets the image map associated with the chart.
ChartModelGets or sets the Javascript Chart Model of the chart for the purpose of support track cursors.
ChartMetricsGets or sets the chart metrics of the chart.
ChartSizeModeDetermines the sizing method of the WebChartViewer control.
ContentDispositionThe suggested filename to use when user saves the chart image as a file on the browser side.
ImageSessionIdThe name of the session variable to temporarily store the chart image.
ViewPortLeftGets or sets the position of the left side of the viewport.
ViewPortTopGets or sets the position of the top side of the viewport.
ViewPortWidthGets or sets the width of the viewport.
ViewPortHeightGets or sets the height of the viewport.
MouseUsageGets or sets the mouse usage mode.
ZoomDirectionGets or sets the zoom direction for mouse zoom in/out actions.
ScrollDirectionGets or sets the scroll direction for mouse scroll actions.
ZoomInRatioGets or sets the magnification ratio for each zoom in click of the mouse.
ZoomOutRatioGets or sets the magnification ratio for each zoom out click of the mouse.
ZoomInWidthLimitGets or sets the viewport width at maximum zoom in.
ZoomOutWidthLimitGets or sets the viewport width at maximum zoom out.
ZoomInHeightLimitGets or sets the viewport height at maximum zoom in.
ZoomOutHeightLimitGets or sets the viewport height at maximum zoom out.
MinimumDragGets or sets the minimum mouse drag distance before it is considered as an intentional drag.
SelectionBorderWidthGets or sets the border width of the zoom selection box.
SelectionBorderColorGets or sets the border color of the zoom selection box as an HTML color.
ZoomInCursorGets or sets the mouse cursor to be used when the mouse is used for zoom in.
ZoomOutCursorGets or sets the mouse cursor to be used when the mouse is used for zoom out.
NoZoomCursorGets or sets the mouse cursor to be used when the mouse is used for zoom in/out, but the zoom in/out limits has been reached.
ScrollCursorGets or sets the mouse cursor to be used when the mouse is used for scrolling.
Note: Properties inherited from System.Web.UI.WebControls.Image are omitted.

Methods
NameDescription
OnPageInitHandles the Web Form Init event to support dynamically created WebChartViewer or WebViewPortControl.
GetPostBackURLCreates a special URL to represent post back operation for use in image maps.
IsPartialUpdateRequestChecks if the current HTTP Request is a partial update request (AJAX request) sent using JsChartViewer.partialUpdate.
IsStreamRequestChecks if the current HTTP request is a stream update request sent using JsChartViewer.streamUpdate.
IsAttachmentRequestChecks if the current partial update request (AJAX request) is an attachment request sent using JsChartViewer.partialUpdateAsAttachment.
IsViewPortChangedEventChecks if the JsChartViewer.ViewPortChanged event has occurred.
GetSenderClientIdGets the id of the JsChartViewer that sends the current HTTP request.
LoadViewerStateLoads the state of the JsChartViewer into the WebChartViewer in partial chart updates (AJAX chart updates).
PartialUpdateChartSends the response to a partial chart update request.
StreamChartSends the chart out as a MIME stream.
StreamImageSends the image out as a MIME stream.
SetCustomAttrSets a custom attribute.
GetCustomAttrGets a custom attribute.
setFullRangeDefines the full range of a viewport data scale.
getValueAtViewPortConverts a viewport coordinate to a value of the specified data scale.
getViewPortAtValueConverts a value of the specified data scale to a viewport coordinate.
syncLinearAxisWithViewPortSynchronizes a linear Axis with the part of the data scale in viewport.
syncLogAxisWithViewPortSynchronizes a logarithmic Axis with the part of the data scale in viewport.
syncDateAxisWithViewPortSynchronizes a date/time Axis with the part of the data scale in viewport.
Note: Methods inherited from System.Web.UI.WebControls.Image are omitted.

Events
NameDescription
ClickHotSpotThis event occurs when the mouse is clicked on a hot spot of the chart image.
ViewPortChangedThis event occurs when the viewport is changed by mouse actions in the browser side Javascript ChartViewer (JsChartViewer).
Note: Events inherited from System.Web.UI.WebControls.Image are omitted.