How can I create a line chart with two different scales using g.raphael or jquery svg? -
i need plot torque curve similar graph here http://www.fordscorpio.co.uk/flatspot.htm in javascript..preferably using g.raphael. suggestions welcome. thank you!
you can create own axis objects follows. (have lost source/gist url snippet can't give credit it's due)
axis = r.g.axis(85,230,310,null,null,4,2,["1", "2", "3", "4"], "|", 0); axis.text.attr({font:"12px arial", "font-weight": "regular", "fill": "#333333"}); // y-axis denoted setting orientation 1 axis2 = r.g.axis(40,230,300,0,400,10,1);
so create normal line graph 2 series , draw axis
otherwise, set multiple axes , tweak labels :-
var lines = r.g.linechart(10, 10, 300, 220, [[1, 2, 3, 4, 5, 6, 7],[3.5, 4.5, 5.5, 6.5, 7, 8]], [[12, 32, 23, 15, 17, 27, 22], [10, 20, 30, 25, 15, 28]], {nostroke: false, axis: "1 1 1 1", symbol: "o", smooth: true}); lines.axis[0].text.items[3].attr('text','my label');
Comments
Post a Comment