updated: Function

Sets the updated event handler for ToolTip that gets triggered whenever toolTip content is updated.


Default: null
Example: updated: function(e){
    alert(“X Value” + e.entries[0].xValue);
  },

Note
  • updated event handler can be used to sync toolTip across multiple charts in a page.


var chart = new CanvasJS.Chart("container",
{
 .
 .
 toolTip: {
   .
   .
   updated: function ( e ) {
     console.log("X Value for which toolTip is shown: " + e.entries[0].xValue);  
   }  
  }],
 .
 .
});
chart.render();


Event Object

e: {
	entries: [{
		xValue,
		dataPoint,
		dataSeries,
		dataPointIndex,
		dataSeriesIndex
	}],
	content: "Updated Content of Tooltip",
	toolTip: {options},
	chart: {}
}


Try it Yourself by Editing the Code below.


  Also See:    



If you have any questions, please feel free to ask in our forums.Ask Question