shutterstock / rickshaw

JavaScript toolkit for creating interactive real-time graphs
https://shutterstock.github.io/rickshaw
MIT License
6.53k stars 941 forks source link

X axis orientation option "bottom" does not work with Rickshaw.Graph.Axis.Time #286

Open jasonzietz opened 11 years ago

jasonzietz commented 11 years ago

Orientation option "bottom" does not work with a time X axis. The following creates an axis with proper labels but they are positioned above the X axis:

var x_axis = new Rickshaw.Graph.Axis.Time ({ graph: graph, orientation: 'bottom', element:document.getElementById('x_axis'), });

Changing the Axis type to non-time (Rickshaw.Graph.Axis.X) results in the labels being in the correct place.

tomchinery commented 11 years ago

I had a similar issue, all I did was take out the orientation line altogether and it seemed to work. This obviously needs a fix.

themasch commented 11 years ago

I tried to fix this issue in my fork by subclassing Rickshaw.Graph.Axis.X for Axis.Time. Seems to work fine but I have some issues with the unit tests and don't want to submit a pull request until I'm sure I didn't broke anything.

Here is the branch: https://github.com/themasch/rickshaw/tree/axis-time-fix

themasch commented 10 years ago

@bjonen sorry, nothing left from that. I may create something if I find some free time. Not sure about the quality about this quick fix either ;)

bjonen commented 10 years ago

@themasch Thanks for letting me know. In the meantime this quick fix proposed in answer to issue https://github.com/shutterstock/rickshaw/issues/158 should do.