chart js custom legend click event

The chart will scale the given path to the appropriate size to fit it in the legend. Now when you click the legend in this chart, the visibility of the first two datasets will be linked together. The default action is to toggle the visibility of the series. onLeave: function The legendEntry value and name properties can contain tokens and expressions as well. The legend title configuration is nested below the legend configuration using the title key. For NPM users: ... legend; datalabels; flags; crosshairs; Demo. An item label displays the series title. legend. When series have entries in the legend a particular point entry can be added to the legend by setting the points legendEntry_visible to true. However when a series has a palette property set, a legend entry for each point of the series is added in place of the series legend entry. However, legend entries can also show points, axis marker, and custom entries. With custom legend entry icons, legend entries can even be used as clickable buttons similar to uiItems. It is highly customizable, but configuring all of its options remains a challenge for some people. The function has the chart, and the click event (e), as arguments. onHover: function: A callback that is called when a 'mousemove' event is registered on top of a label item. By default, legend entries are interactive and when clicked they provide a useful action depending on what the entry represents. Give it a try. var chart = new CanvasJS.Chart("container", Adding buttons on d3.js charts. There are all sorts of things that can wrong, and I often just want to have something working so I can start tweaking it.. exporting), add