Skip to content Skip to sidebar Skip to footer

How Do You Get A Y-axis That Starts At Zero In Graphael, If None Of Your Values Are Zero?

I wish to create a graph whose y-axis starts at 0. None of my values are 0 though. How do i go about doing that in graphael ? As an extension, how can I create a graph with a y-ax

Solution 1:

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

You can add in another array of y values (the first being 0 and last being 2x your max value) and specify the color for this line to be transparent using the colors option.

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

The first chart is what you currently have and the second shows the addition of the second set of y values.


Post a Comment for "How Do You Get A Y-axis That Starts At Zero In Graphael, If None Of Your Values Are Zero?"