score:0
i found my answer by this way. thanks!
var ctx = document.getelementbyid("chart-area").getcontext("2d");
if(mypie!=null){
mypie.destroy();
}
mypie = new chart(ctx, config);
score:0
to destroy chart, you need to call "destroy" method on variable, which contains an instance of the chart. simple example for your case:
var ctx = document.getelementbyid("chart-area").getcontext("2d");
var mypie = new chart(ctx, config);
...some additional code...
// destroy mypie instance
mypie.destroy();
Source: stackoverflow.com
Related Query
- destroy method implementation in pie chart chartjs
- Chartjs destroy method not affecting the chart
- Chartjs random colors for each part of pie chart with data dynamically from database
- chartjs datalabels change font and color of text displaying inside pie chart
- Display values outside of pie chart in chartjs
- ChartJS 2.0 - Huddle labels on pie chart
- Angular 8 & ChartJs change color in pie chart
- Pie chart is not getting rendered in ChartJS
- ChartJS Doughnout Chart Pie Offset on Hover
- Custom data in label on ChartJS pie chart
- ChartJs - Pie Chart - how to remove labels that are on the pie chart
- Use transparent stroke color with chartjs pie chart
- Print pie chart in chartjs
- ChartJS version 3 how to add percentage to pie chart tooltip
- canvas fill text vanishes when hovering over chartjs pie chart
- chartjs Adding percentages to Pie Chart Legend
- Hide labels from pie chart in chartjs
- How to get labels on ChartJS Pie chart segments
- How can I change the cursor on pie chart segment hover in ChartJS 3?
- ChartJS pie chart with simple parsing options doesn't render, only works when set as bar/line chart
- How to make chartjs pie chart responsive
- How to group smaller Pie Chart slices together to Improve Readability in chartjs
- Make chartjs pie chart wiyh dynamic data
- how to display name on multi series pie chart in chartjs
- Legend color not working with randomly generated background colors in chartjs pie chart
- ChartJS Pie Chart How default just show 2 legend datas
- chartJS pie chart not updating after axios GET
- Show/hide All nested data in ChartJS Pie chart when outer is shown/hidden
- How to set up a simple pie chart using React in ChartJS on codesandbox
- ChartJS - How to add Text between Pie Chart and Legend
More Query from same tag
- Multiple dynamic vertical lines on a chart with Chart.js
- How to change the default barchart colour in chart.JS and angular 7?
- How can I remove two labels from my legend with an alternative to item.datasetIndex !== 1 && item.datasetIndex !== 4; ? (Charts.js)
- chartjs + Angular6 is not showing charts or any error
- chart.js My DATA doesn't go along with the label,
- How to Display Chart.js line-chart from a MVC Controller
- charts.js - json output to graph
- Inserting percentage charts.js doughnut
- Render pie chart datasets out of 100% -- Chart.JS
- How to use plugin in chartjs-node?
- Point unselection in ChartJS
- Displaying dataset labels in Chart.js line graph
- Count the duplicates in a string array using React JS
- Vue3 does not show line-chart
- ChartJs doesn't display the line item legend
- How to add margin bottom in Tittle ChartJS
- (scaled) y value for given x value
- Chart.js change color of Bar
- How to add a coloured legend box to a pie chart with Chart.js v1?
- Chart.js v3.2 Change Radar background shape from Polygonal-Triangle to Circular
- Chart.js how to change width of color
- How to mapping variable data for pie chart (react.js)
- Chart.js is not displayed when page loads first time
- First implementation - Chart object seems to be incomplete
- chart.js datapoint offset multiple charts
- Load ChartJS via VueJS - ChartJS empty and 0px dimension
- how can i remove the decimals from the tick when im zooming?
- Problem with Charts.js in vue. anyone can help step by step
- How to export report as PDF/CSV in ChartNew.js
- Chart.js Increase font size for higher resolution (i.e. monitor-agnostic chart configuration )