Search code examples
jquerytooltipflotstacked-area-chart

Flot chart stackpercent tooltip with line chart %p not working


So I'm using flot charts and the stackpercent plugin which says to provide support for the flot tooltip plugin. Now I am using the plugin with a line chart instead of a bar chart. This seems to still work with the plugin, but for some reason the flot tooltip doesn't display the %p properly. It just shows the text '%p' rather than the percentage. Any ideas?

Update: I thought it might have to do with the fact that I was using a line chart and not a bar chart like the examples for the plugin, but they aren't appearing for the bar chart either...


Solution

  • The current tooltip plugin only supports percent with pie charts. The jquery.flot.stackpercent.js plugin stores the percents internally a little different since it needs to work with multiple series.

    Fear not, though, I forked the tooltip plugin and added support here.

    Here's a demo fiddle.