Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Any idea on how to scale the xAxis based on time in hours? #38

Open
makayait opened this issue Aug 23, 2019 · 0 comments
Open

Any idea on how to scale the xAxis based on time in hours? #38

makayait opened this issue Aug 23, 2019 · 0 comments

Comments

@makayait
Copy link

I have looked at Chartjs examples in Javascript and tried to implement the dart version of it with the following result.

var xAx = charts.ChartXAxe(
    display: true,
    barThickness: 2,
    type: 'time',
    time: charts.TimeScale(
      parser: "HH:mm:ss",
      unit: 'hour',
      unitStepSize: 1,
      //round: 'hour', // this will round the data.
      tooltipFormat: "HH:mm:ss",
      displayFormats: charts.TimeDisplayFormat(hour: 'HH:mm:ss'),
    ),
  );

putting this xAxis configuration inside of my ChartConfiguration;

var config = charts.ChartConfiguration(
    type: 'line',
    data: data,
    options: charts.ChartOptions(
      responsive: true,
      scales:
          charts.ChartScales<charts.TickOptions>(xAxes: [xAx], yAxes: [yAx]),
    ),
  );

This, however, crashes without any error messages.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant