views:

41

answers:

1

I have weather history data which I need to plot on a web page using (highly recommended) jquery flot. The app behind is in RoR.

One of the data series describes overall weather state for a date such as 'heavy showers', 'light snow', etc.

Now flot expects decimals in data input. Flot also allows to reformat data when it comes down to showing data points/axis ticks to user.

Here is how data travels:

strings (coming out of ruby) -> decimals (flot in) -> strings (flot out)

Obvious solution would be to 'alias' each label with decimal and then use whatever version is appropriate at a particular step. That was my plan up until I came to realize that certain labels in fact have the same weight (that is, should be plotted on the same line). For instance, 'light rain' and 'light snow' are clearly as good(bad) as each other (one might disagree though, but let us just assume they are).

So, there goes the problem: how to plot those as the same values and yet be able to show original labels?

+1  A: 

I'm not familiar at all with flot, but..

Would it be possible to use very similar values that are not exactly the same ?

For instance, light showers = 3.01, light snow = 3.02

I guess your problem would be to make them sufficielty different so the labels will plot without overlap on (presumably) y axis

Steve De Caux
+1, that is what I was thinking about too.
artemave