AnyChart | How to show information about a period i...
Welcome, Guest Login

Support Center

How to show information about a period in a tooltip?

Last Updated: Oct 08, 2015 04:02AM MDT
contentFormatter() function takes an eventObject [object], this object has 3 fields:

‘item’: DataItem,
‘hoveredIndex’: number,
‘period’: Object (current period)

To show the period id and name in the tooltip you need to use a code like this:

var timeLine = chart.getTimeline();
timeLine.tooltip().contentFormatter(function(eventObj){
    var item = eventObj.item;
    var periods = eventObj.period;
    return 'name: ' + item.get('name') + ' id: ' + periods.id;
  });

Just like is shown in this AnyGantt Sample of JS Gantt chart with a custom tooltip.

Contact Us

support@anychart.com
http://assets0.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete