renderScatterTimedChart method

  1. @override
RenderedChartJS renderScatterTimedChart(
  1. Element output,
  2. ChartTimeSeries chartSeries
)
override

Renders a Scatter Chart Timed with DateTime values in X axis:

Implementation

@override
RenderedChartJS renderScatterTimedChart(
    Element output, ChartTimeSeries chartSeries) {
  checkRenderParameters(output, chartSeries);
  checkLoaded();

  var canvas = asCanvasElement(output);

  var seriesPairs = chartSeries.seriesAsPairsOfMap(
      sortSeriesByCategory: chartSeries.options.sortCategories,
      mapDateTimeToMillis: true);

  chartSeries.ensureColors(colorGenerator);

  var colors = chartSeries.colors!;

  var renderArgs = [
    canvas,
    chartSeries.title,
    chartSeries.xTitle,
    chartSeries.yTitle,
    _xAxisMinMax(chartSeries),
    _yAxisMinMax(chartSeries),
    JsObject.jsify(seriesPairs),
    _verticalLinesConfig(chartSeries),
    JsObject.jsify(colors),
    true,
    _onClick(chartSeries)
  ];

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

  return RenderedChartJS(
      this, 'scatter-time-series', chartObject, chartSeries);
}