Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

legend on click use default chartjs

// How to implement a custom behaviour when clicking on a legend element
var original = Chart.defaults.global.legend.onClick;
Chart.defaults.global.legend.onClick = function(e, legendItem) {
  /* do custom stuff here */
  original.call(this, e, legendItem);
};
Source by github.com #
 
PREVIOUS NEXT
Tagged: #legend #click #default #chartjs
ADD COMMENT
Topic
Name
7+3 =