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.
  1. var chart = new CanvasJS.Chart("container",
  2. {
  3. .
  4. .
  5. toolTip: {
  6. .
  7. .
  8. updated: function ( e ) {
  9. console.log("X Value for which toolTip is shown: " + e.entries[0].xValue);
  10. }
  11. }],
  12. .
  13. .
  14. });
  15. chart.render();

Event Object

  1. e: {
  2. entries: [{
  3. xValue,
  4. dataPoint,
  5. dataSeries,
  6. dataPointIndex,
  7. dataSeriesIndex
  8. }],
  9. content: "Updated Content of Tooltip",
  10. toolTip: {options},
  11. chart: {}
  12. }

Try Editing The Code

  Also See:    


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