NOTE: This section describes Programmable Track Cursor for web applications only. For Windows applications, please refer to Programmable Track Cursor (Windows).
ChartDirector 7.1 (.NET Edition)
Programmable Track Cursor (Web)
Introduction
Javascript Chart Model
Track Cursor Events
JsChartViewer Drawing Methods
Method | Description |
---|---|
JsChartViewer.drawHLine | Draws a horizontal line on the chart. |
JsChartViewer.drawVLine | Draws a vertical line on the chart. |
JsChartViewer.showCrossHair | Displays the crosshair cursor. |
JsChartViewer.showTextBox | Draws a textbox on the chart. |
JsChartViewer.showClickableTextBox | Draws a clickable textbox on the chart. |
JsChartViewer.hideObj | Hides one or more objects drawn by JsChartViewer. |
JsChartViewer.setAutoHide | Hides one or more objects drawn by JsChartViewer when a certain event occurs. |
JsChartViewer.removeAutoHide | Cancels the automatic action sets up by JsChartViewer.setAutoHide. |
JsChartViewer.htmlRect | Generates HTML code that represents an inline color box. |
Snapping to the Nearest X Data Position
Files Required for Javascript Chart Viewer
Filename | Description |
---|---|
cdjcv.js | The main Javascript library file. |
wait.gif | Rotating clock wait symbol. |
spacer.gif | A 1-pixel transparent image. |
zoomin.cur | Zoom in cursor. |
zoomin.cur | Zoom out cursor. |
Sample Track Cursors
Sample Code | Description |
---|---|
Track Line with Legend (Web) | Demonstrates a track cursor that consists of a vertical line snapped to the nearest x data position. There are dots to highlight the nearest data points, and a dynamically updated legend showing their values. |
Track Line with Data Labels (Web) | Demonstrates a track cursor that consists of a vertical line snapped to the nearest x data position with a floating x-axis label. There are also dots to highlight the nearest data points, with labels beside them displaying their values. |
Track Line with Axis Labels (Web) | Demonstrates a track cursor that uses horizontal and vertical lines to connect the nearest data points to the x-axis and y-axis, with floating axis labels showing their values. |
Track Line with Vertical Legend (Web) | Demonstrates a track cursor that consists of a vertical line snapped to the nearest x data position. There are dots to highlight the nearest data points, and a dynamically updated vertical legend showing their values. The legend box is put on the left side of the plot area if the track cursor is on the right side and vice versa. This ensures the legend box would not block the region near the track cursor. |
Track Box with Floating Legend (Web) | Demonstrates a track cursor that consists of a rectangle enclosing the slot corresponding to the nearest x-axis label. A floating legend box that moves with the mouse cursor is used to display the data values in that slot. |
Crosshair with Axis Labels (Web) | Demonstrates a track cursor that consists of a vertical line and a horizontal line at the mouse cursor position, thereby forming a crosshair. Floating axis labels are used to display the cursor position. |
Finance Chart Track Line (Web) | This is similar to Track Line with Legend (Web), but is modified to apply to the FinanceChart object. |
Zooming and Scrolling with Track Line (Web) | Demonstrates how to apply track cursors to a Zoomable and Scrollable chart. The track cursor drawing code is the same as that in Track Line with Legend (Web). |
Zooming and Scrolling with Viewport Control (Web) | Demonstrates how to apply track cursors to a Zoomable and Scrollable chart. The track cursor drawing code is the similar to that in Track Line with Legend (Web). |
Real-Time Chart with Track Line (Web) | Demonstrates how to apply track cursors to a Realtime chart. The track cursor drawing code is the same as that in Track Line with Legend (Web). |