By default, a very generic tooltip exists on the chart, but we have the ability to change this to whatever we want using the tipRenderer
config. The tipRenderer
accepts a function as the value, which needs to return a text string to use for the tooltip text. The default is this boring information, which is nothing we can't glean from the chart itself. I want more.
Note
Tooltips can be styled just like the other components of a chart using the options available in the extraStyles
config object.
What if we were informed by the tooltip which movie titles made up the data at this particular point on the chart? Now that would be useful. Our function just needs to return a string; other than that requirement we can do whatever we need to, like in this case where we will loop through our movies to get the titles of each movie in the appropriate genre, filmed in the corresponding year.
{ xtype: 'linechart', ... tipRenderer : function(chart, record, index, series){ var genre = series.displayName...