Skip to content

To have event listener enabled and toggleDataSeries disabled for legend in the same time #835

@ShuxinLin

Description

@ShuxinLin

Codepen

Please check codepen here.

Explanation

In the radial bar, I want to add an event listener to onclick of the legend, but I want to disable toggleDataSeries behavior when clicking the legend. In the first step, I add event listener by

          chart: {
            events: {
              legendClick: function(chartContext, seriesIndex, config) {
                console.log(seriesIndex);
              }
            }
          },

And the event listener works! Then I tried to set toggleDataSeries to be false by

        legend: {
          onItemClick: {
            toggleDataSeries: false
          }
       }

Then event listener does not work anymore because the legend is not clickable. Can I have event listener enabled and toggleDataSeries disabled in the same time?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions