How can you toggle between two sets of values per data series in flot?

Posted by Jedidja on Stack Overflow See other posts from Stack Overflow or by Jedidja
Published on 2010-02-18T17:54:19Z Indexed on 2010/04/15 16:13 UTC
Read the original article Hit count: 321

Filed under:
|

flot has built-in support for multiple data series (sample code) and also dual-axis (sample code).

Assuming multiple data series (water, electricity, etc) that each have an amount (usage) and a dollar value (charge for that usage), what would the best way be to to use flot to display either the amount or dollar values for all the data series, while still supporting toggling display for each individual series?

The idea is to send down all the data in one GET request and then let the client take care of everything else in Javascript. Ideally we could use triplets somehow {date, amount, charge}, and then possibly split that into two arrays for flot.

© Stack Overflow or respective owner

Related posts about flot

Related posts about jQuery