0

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...

Zach Saucier
  • 24,871
  • 12
  • 85
  • 147
user3129120
  • 113
  • 11
  • 1
    Please can you provide your code in question, or even better a [jsfiddle](http://jsfiddle.net/) so can see issue – James P Jul 19 '14 at 10:07

1 Answers1

2

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.

Mark
  • 106,305
  • 20
  • 172
  • 230
  • Thans for responding. I have tried installing the latest foot tooltip but for some reason it isn't working. I have seen it used in the way you have shown... – user3129120 Jul 19 '14 at 19:47
  • @user3129120, by "latest", do you mean the one I fixed to work with the stackpercent plugin? https://github.com/larsenmtl/flot.tooltip/blob/master/js/jquery.flot.tooltip.js – Mark Jul 19 '14 at 19:49
  • yeah. I did a bower install for the latest. That should work right? The code seems to be the same... – user3129120 Jul 19 '14 at 23:38
  • Did you install from my fork? – Mark Jul 19 '14 at 23:47
  • Thanks for being so responsive! I think i did. Could you tell me exactly how to do that? My last resort will be trying to copy the file directly (although I might have done that before) – user3129120 Jul 20 '14 at 07:04
  • @user3129120, I'm not familiar with bower. I just tried installing it and npm won't play nice with my company's proxy server. I'm probably missing something here, but I can't see how bower is easier then just downloading a file... – Mark Jul 21 '14 at 14:26
  • thanks for the help! yeah i tried just copying the file you linked and that worked. Thanks so much! – user3129120 Jul 21 '14 at 16:52