renderLineChart method

  1. @override
RenderedChartJS renderLineChart(
  1. Element output,
  2. ChartSeries chartData
)
override

Renders a Line Chart:

Implementation

@override
RenderedChartJS renderLineChart(Element output, ChartSeries chartData) {
  checkRenderParameters(output, chartData);
  checkLoaded();

  var canvas = asCanvasElement(output);

  var series = chartData.options.sortCategories
      ? chartData.seriesSortedByCategory
      : chartData.series;

  chartData.ensureColors(colorGenerator);

  var colors = chartData.colors!;

  var renderArgs = [
    canvas,
    chartData.title,
    chartData.xTitle,
    chartData.yTitle,
    JsObject.jsify(chartData.xLabels),
    _xAxisMinMax(chartData),
    _yAxisMinMax(chartData),
    JsObject.jsify(series),
    _verticalLinesConfig(chartData),
    JsObject.jsify(colors),
    chartData.options.fillLines,
    chartData.options.straightLines,
    chartData.options.steppedLines,
    _onClick(chartData)
  ];

  var chartObject = _jsWrapper!.callMethod('renderLine', renderArgs);

  return RenderedChartJS(this, 'line', chartObject, chartData);
}