Dual Scale Y Axis Graphs?

10 views
Skip to first unread message

Rickms

unread,
Aug 17, 2009, 1:13:36 PM8/17/09
to Flotr Javascript Plotting Library
Hi all,

I'm trying to plot two series on a graph with different Y axis scales,
and a fixed X axis, in this case X is Time.

Series A has a value on the Y axis.
Series B is a percentage

I would like to have a graph that shows A vs B over time.

Example.
A.x = Time, A.y = mph of a vehicle.
B.x = A.x, B.y = percentage of fuel remaining.

Thanks for any help.

Rick

Fabien Ménager

unread,
Aug 17, 2009, 1:23:08 PM8/17/09
to Flotr Javascript Plotting Library
Hello, you can do so by using the Dual axis feature :
Simply provide the second series as this :

{data: [[0, 2], [1, 5], [3, ...]], yaxis: 2, label: 'The data on the
second axis'}

By default, yaxis is 1, the only two options are 1 (left) and 2
(right)

instead of simply
[[0, 2], [1, 5], [3, ...]]

I suggest you to try the Flotr playground (http://phenxdesign.net/
projects/flotr/playground/) to see the other available options and
help you get what you want.

Fabien
Reply all
Reply to author
Forward
0 new messages