color the background of the chart based on data

301 views
Skip to first unread message

Zanardi

unread,
Jan 27, 2011, 4:29:24 AM1/27/11
to flot-...@googlegroups.com
Hi,

I need a chart like this one:

img841.imageshack.us/img841/9985/graficobackcolor.png

Is a time series: the graph shows the velocity profile during the day.

I need to add another data set to color the background of the chart. As in the sample.

Thanks,
Zanardi

George Roberts

unread,
Jan 27, 2011, 11:44:33 AM1/27/11
to flot-...@googlegroups.com
There is an annotate or markup plugin that will do this. Someone else on
this list will know more than me but here is some code that doesn't use a
plugin that asks plot for the location of points within the canvas and then
uses canvas commands to draw - small changes to make this draw what you
want.

http://jumware.com/Includes/jquery/Flot/Examples/annotating.html

- George Roberts
http://gr5.org

Armin Krauss

unread,
Oct 18, 2011, 2:18:24 PM10/18/11
to flot-...@googlegroups.com
Hello George and Zanardi,

sorry to open up this again, but I want to do something very similar to Zanardi, where I want to colour the background
according to data (two colours to make things easy - high and low kind of thing).

George was pointing to the annotation feature and then I read something about canvas and it sounded like the new API
might change how the annotation is done.

Can anyone point out to me how this could be approached?

Thanks

Armin

steve donovan

unread,
Oct 19, 2011, 6:17:01 AM10/19/11
to flot-...@googlegroups.com
On Tue, Oct 18, 2011 at 8:18 PM, Armin Krauss <mack...@googlemail.com> wrote:
> Zanardi, where I want to colour the background
> according to data (two colours to make things easy - high and low kind of
> thing).

So the threshold plugin would not do? That fills in the lines
above/below some threshold.

steve d.

Juan Mendes

unread,
Oct 24, 2011, 6:36:41 PM10/24/11
to flot-...@googlegroups.com
threshold plugin changes the color of the line, not of the background
--
Juan Mendes
Reply all
Reply to author
Forward
0 new messages