How do you get a y-axis that starts at zero in the plot if none of your values ​​are zero?

I want to create a graph whose y-axis starts at 0. None of my values ​​are 0. How can I do this in a graph?

As an extension, how can I create a graph with a y-axis whose maximum value is, say, double the maximum value in the data provided?

+2


source to share


1 answer


I don't know if it's too late, but I struggled with gRaphael myself and found a solution that might work for you. There's no obvious or clean way to do this, but I found a decent hack for it.

You can add to another array of y values ​​(the first one is 0 and the last one is 2x your maximum value) and specify the color for this line to be transparent using the parameter colors

.



I created a fiddle so you can see what I mean: jsFiddle example

The first diagram is what you now have, and the second shows the addition of a second set of y values.

+3


source







All Articles