renderTimeSeriesChart method

  1. @override
RenderedApexCharts renderTimeSeriesChart(
  1. Element output,
  2. ChartTimeSeries chartData
)
override

Renders a Time Series using Line Chart:

Implementation

@override
RenderedApexCharts renderTimeSeriesChart(
    Element output, ChartTimeSeries chartData) {
  checkRenderParameters(output, chartData);
  checkLoaded();

  var div = asDivElement(output);

  var timeSeries = chartData.seriesAsPairsOfList(
      sortSeriesByCategory: chartData.options.sortCategories,
      mapDateTimeToMillis: true);

  timeSeries = _reverseSeries(timeSeries);

  chartData.ensureColors(colorGenerator);

  var colors = chartData.colors!;

  var renderArgs = [
    div,
    chartData.title,
    chartData.xTitle,
    chartData.yTitle,
    _xAxisMinMax(chartData),
    _yAxisMinMax(chartData),
    JsObject.jsify(timeSeries),
    _verticalLines(chartData),
    JsObject.jsify(colors),
    chartData.options.fillLines,
    chartData.options.straightLines
  ];

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

  return RenderedApexCharts(this, 'time-series', chartObject, chartData);
}