How can I sort, insert in between and update full dataset in chartjs?
问题 I have a few issues with chartjs which simple update method won't solve. I wonder if there is an option to: painlessly sort the datasets; insert some data in between two points; reload the whole chart without replacing the canvas with a completely new chart? 回答1: There is no option built in, but it is pretty easy to write your own using the addData , removeData methods that Chart.js provides. var MyBarChartMethods = { // sort a dataset sort: function (chart, datasetIndex) { var data = []