Home Forums Feature Requests & Feedback On click event

On click event

Viewing 3 posts - 1 through 3 (of 3 total)
  • #14531

    Can selected datapoint highlight on click?

    #14537

    @mahi2000,

    To highlight a dataPoint on mouse click, you can use the click property to set the click event handler which is triggered when user clicks on a dataPoint.
    Upon event, you will get access to the selected dataPoint’s details. In the case of highlighting a dataPoint, you can use the event related data to change the selected dataPoint’s color property.

    Please take a look at the code snippet below,

    function onClick(e){
    	if(!e.dataPoint.color) {
      	e.dataPoint.color = "red";
      } else {
      	e.dataPoint.color = null;
      }
      chart.render();
    } 

    Please take a look at this JSFiddle for an example with complete code for attaching click event to highlight datapoint.

    attaching click event to highlight datapoint
    —-
    Bivek Singh

    #14540

    Thanks Bivek :)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.