ChartCanvasSerie.DrawContext

Syntax

DrawContext: CanvasRenderingContext2D;

Description

The DrawContext property determines draw context for the chart data series.

Comments

The property is read-only.

Example

Executing the example requires that the HTML page contains the Chart component named chart (see Example of Creating a Line Chart). Draw series name for the first data series in the chart:

// Get the first data series
var serie = chart.getSerie(0);
// Get the first point in the series
var point = serie.getPoint(0);
// Get draw context for the chart data series
var context = serie.getDrawContext();
// Draw text in the canvas
context.fillText(serie.getName(), point.getPlotX() + 5, point.getPlotY() + 5);

After executing the example series name is drawn for the first data series in the chart:

See also:

ChartCanvasAxis