Comments (1)
Fixed by just checking if there is any data on the chart.
if (resultHistoryChart.data.datasets[0].data.length > 0) {
resultHistoryChart.options.plugins.trendlineLinear = true;
} else {
resultHistoryChart.options.plugins.trendlineLinear = false;
}
from chartjs-plugin-trendline.
Related Issues (20)
- Angular 12.1.2 | Typescript error while importing chartjs-plugin-trendline HOT 7
- Simple Gradient Line HOT 2
- New error: Failed to execute 'createLinearGradient' HOT 2
- Is data structure only support number array? HOT 1
- Not working with chart.js Version 4.x HOT 4
- Bug: Trendline is broken when data is an object HOT 4
- arithmetic moving average is not working HOT 1
- Bug in 2.0.3: Error when first data point is 0, "The provided double value is non-finite" HOT 1
- trendline does not support time scale? HOT 9
- trendline does not support different line style? HOT 4
- Add label to trendline HOT 1
- Error when there is less than two non-null values HOT 1
- console.log('forEach') HOT 1
- Feature request: trendoffset or trendrange HOT 1
- Include Trendline in legend
- can't load directly in browser version 2.2.1 with chartjs 4.4.3 HOT 4
- Can't load version 2.1.1: Module has no exports HOT 5
- Issue with Vite and Docker HOT 5
- Mysterious "not a finite floating-point value" error HOT 2
- Trendline not showing when using Chart.js Object Data Structure v2.1.2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chartjs-plugin-trendline.