chartjs-plugin-regression icon indicating copy to clipboard operation
chartjs-plugin-regression copied to clipboard

Does not work with axis type "time".

Open y0nd0 opened this issue 5 years ago • 3 comments

Data

// [Date, number]
const data = [
  [new Date('2020-01-01'), 42],
  [new Date('2020-01-02'), 87],
  [new Date('2020-01-03'), 27],
  [new Date('2020-01-04'), 13],
  [new Date('2020-01-05'), 7],
  [new Date('2020-01-06'), 33],
  [new Date('2020-01-07'), 66],
];

Scale Option

scales: {
  xAxes: [
    {
      type: 'time',
    },
  ],
}

It only works when I remove the type: 'time' option from the xAxis. (same data) Otherwise with time type, the line is just not drawing without errors.

y0nd0 avatar Feb 06 '21 18:02 y0nd0

Hello @pomgui , thanks for this plugin, I also have the same problem mentioned by @y0nd0 using a scatter chart with time. Plugin seems loaded, but no regression lines are showed, and nothing in the console.

I'm wondering how to debug this issue?

MariusMez avatar Mar 22 '21 18:03 MariusMez

Hi @pomgui! I too have the same problem using a scatter chart with time. Any workaround?

gvendraminetto avatar Apr 13 '21 12:04 gvendraminetto

@MariusMez and @gvendraminetto did you manage to figure this out? I'm facing the same problem.

mobbsie avatar Mar 11 '23 11:03 mobbsie