pomgui / chartjs-plugin-regression Goto Github PK
View Code? Open in Web Editor NEWChart.js plugin to calculate and draw statistical linear, exponential, power, logarithmic, and polynomial regressions.
License: ISC License
Chart.js plugin to calculate and draw statistical linear, exponential, power, logarithmic, and polynomial regressions.
License: ISC License
Hey, thanks for this plugin!
In some cases the line seems to be rendered incorrectly:
I also ran into a similar problem when multiple data points had the same value on the x-axis: the line would be shorter and not span the entire canvas but stop in the middle of the chart. Would it be possible to render the line from the first to the last datapoint, so that it always spans the whole canvas?
Thank you!
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.
This plugin is not working at v2.9.4.
Error in mounted hook: "TypeError: Cannot read property 'id' of undefined"
import ChartRegressions from 'chartjs-plugin-regression'
const { reactiveProp } = mixins;
export default {
extends: Bar,
mixins: [reactiveProp],
props: ["options"],
mounted() {
if (this.options && this.options.plugins) {
const plugins = this.options.plugins;
if (plugins.zoom) {
this.addPlugin({ zoom });
}
this.addPlugin(ChartRegressions)
}
this.renderChart(this.chartData, this.options);
},
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.