score:3
You can extend the chart and override the starting values for the animation in the initialize override, like so
Chart.types.Line.extend({
name: "LineAlt",
initialize: function(data){
Chart.types.Line.prototype.initialize.apply(this, arguments);
this.eachPoints(function(point, index){
Chart.helpers.extend(point, {
x: this.scale.calculateX(0),
y: this.scale.calculateY(point.value)
});
point.save();
}, this);
}
});
Then just use the extended chart, like so
...
new Chart(ctx).LineAlt(data);
Fiddle - http://jsfiddle.net/kLg5ntou/
Source: stackoverflow.com
Related Query
- how to draw line graph with line animation from left to right using chartjs?
- How to work out Chartjs using TypeScript with Chartjs.definitelyTyped from github
- How to start the line graph from the left Y axis in a line/bar mixed chart (Chart.js)?
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- Chartjs initial animation want to change from left to right (default it is bottom to top)
- How To Match Left and Right Tick Intervals with Chartjs
- Populating Chart.Js line graph with multiple lines using data from a JSON Object
- Can't Draw Horizontal Line on Graph Using ChartJS Annotation Plugin and Primevue Chart
- Draw stacked horizontal bar chart with Average line using ChartJS
- How to get the image from graph created using chartjs
- How do I draw horizontal bars with a label using either ChartJS or D3?
- How to display data from database into line graph using php and mysql?
- How to plot a single value with line in line chart graph using charts.js?
- Display line chart with connected dots using chartJS
- How can I draw dotted line using chartjs?
- How do I draw a vertical line on a horizontal bar chart with ChartJS?
- Draw two plots using chartjs over one another with transparency
- How to draw Horizontal line on Bar Chart Chartjs
- Chartjs line graph dataset with offset
- How to draw round edges with chart.js for line diagrams
- ChartJS - how to display line chart with single element as a line? (not as a dot)
- How to create chartjs chart with data from database C#
- Draw a horizontal bar chart from right to left
- How to create a stacked graph using ChartJS
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- ChartJS / Chartjs-plugin-annotation How to draw multiple vertical lines using an array?
- How to draw multiple line on y axis for same x axis in chartjs v2?
- How to cut line graph in ChartJS
- How to make aspecific API call from within a Line Chart class in ReactJS using react-chartjs-2?
- How to shade between 2 lines on a line graph using chart.js version2
More Query from same tag
- Can't figure out why the values in my objects are changing
- In rails Label X and Y axis in chart. Implemented through chartkick and chart.js
- How can I add an event to chart.js legend?
- Is there a more optimized way to implement the change function of chart js upon changing the dropdowns?
- Chartjs - Insert additional data into chart tooltip
- jQuery convert hex to rgba
- Chart.js label value
- what is output format of Utils? (using chartjs in vanillajs, not react/angular)
- How to create multi scale chart?
- Style individual points from one dataset in Chart.js
- Chart.js How to set line height only to the points?
- Chart.js, how to reduce space between labels and bars (horizontal bar chart)
- update chart data called through ajax via PHP, MySQL
- Bars on second X Axis not showing
- Stacked Group Bar from Chart.js : Can I give each stack group a unique color?
- Chart.JS Display 5 largest values in the legend
- ChartJS - PieChart's Label too long and hide the PieChart
- Calculate x and y coords for bullet trajectory - Chart.js
- error TS2322: Type 'string' is not assignable to type 'keyof ChartTypeRegistry'
- Update of options for PrimeNG Chart needs two calls instead of one
- Angular 5, Chart.js displaying multiple charts, one on each tab
- Rest Api data fetching error while using chartjs
- Different gridline steps on chart js line chart
- Uncaught TypeError: Cannot read property 'format' of undefined
- Chart js with problems when using too many series
- Chart isn't updating with Response data (Chart.js 3.2.1, ng2-charts 3.0.0-beta.9)
- AJAX request not working unless alert() is used
- Is there a way to display a chart label that has no data behind it in Chart.js
- Dynamic array javascript
- ChartJS - change chart type by changing y-axis Label