score:-1
you have to call save64Img(myChart.toBase64Image())
over an additional callback.
You can add this callback to the options
lineOptions = {
onAnimationComplete: function () {
save64Img(myChart.toBase64Image());
}
}
score:1
I know that it's been awhile since you have asked the question, but in the Chart.js v2 you have to use onComplete
method within the animation option.
animation: {
duration: 1500,
onComplete: function (animation) {
this.toBase64Image();
}
Source: stackoverflow.com
Related Query
- Blank PNG image using Chart JS . toBase64Image() function
- Converting Chart.js canvas chart to image using .toDataUrl() results in blank image
- How to save Chart JS charts as image without black background using blobs and filesaver?
- using react-chartjs-2 , How can I save my chart as png using a download button
- How to add image inside the doughnut chart using chart.js?
- 【React chart.js】How to add multiple data to Radar chart using map function
- Refreshing the image of a chart using chart.js
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- Accessing data from the callback function of a bar chart using chart js
- How to constantly update y axis using a C# function to update a Live (Streaming) Chart.js Chart in ASP.NET core Web Application Razor Pages
- How to convert chart.js library chart to image in pure node.js without using HTML and CSS?
- How to run Chart.js samples using source code
- Using chart.js to output chart as a saved image rather than using canvas
- Is there a way to store a chart as an image directly to server using Chart.js?
- How to add text inside the doughnut chart using Chart.js?
- Moving vertical line when hovering over the chart using chart.js
- create a multi line chart using Chart.js
- How to add an on click event to my Line chart using Chart.js
- Display line chart with connected dots using chartJS
- Dynamically update the options of a chart in chartjs using Javascript
- How to Draw Gantt chart using chart js or other libraries
- Detecting hover events over parts of a chart using Chart.js
- Creating chart.js chart directly to PNG in Node js?
- using vue-chartjs in vue 3 : createElement is not a function
- Overlapping Bar Chart using Chart.js
- How to add text in centre of the doughnut chart using Chart.js?
- How to create stacked bar chart using react-chartjs-2?
- Display a limited number of labels only on X-Axis of Line Chart using Chart.js
- Chart.js - Add text/label to bubble chart elements without using tooltips?
- angular-chartjs line chart TypeError: t.merge is not a function
More Query from same tag
- Saving ChartJS chart showing all tooltips
- My choice of color is not used in my stacked bar chart
- Chart.js Line-Chart with different Labels for each Dataset
- Chart.js canvas resize of pie / doughnut chart
- Syntax error : Cannot use import statement outside a module in Vue2 chart js
- chart.js chart-click pass parameter in Angular controller
- Highlight background on a single hour with chart.js and annotations
- Extension for chart.js 2.X
- Synchronous XMLHttpRequest when loading charts.js in to a div
- Chart JS tooltip and label width is zeroed
- chartjs Line chart: scale respect value on x-axis
- Comparison between d3.js and chart.js (only for charts)
- Chart.js not being displayed inside Jquery Dialog
- ChartJS - tooltip of one element is covering point that user should be able to select
- ChartJS replay chart animation when called by show()
- Chart.JS: Show custom labels permanentely on doughnut chart
- charts.js straight lines - i cant find a solution
- Chart.JS Alternate background color for xAxis
- chart.js - user add the final point of the line
- Chart.js legend customisation
- Problems with ChartJS "Uncaught TypeError: Cannot read property 'length' of null"
- How to change the z-index of chartjs annotations label?
- How to create range based ticks in chart js? (like in attached image)
- how to reset the graph/chart after zoomin, pan using chartjs
- Chart.js 3.4/Vue3 How to hide border ticks and set specific amount of grid lines
- How to make dynamic chart using Vue component with chart-js
- Javascript: problems with the order of my index
- Chart js custom datalabel from array
- Rotate left legend chartjs
- How to draw lines between minimum and maximum value to average value in chartJS?