Search code examples
javascriptdygraphs

Vertical graphing in Dygraph?


I'd like to use Dygraphs for a web project, but I need to graph my lines in a "vertical" fashion- meaning- what is normally the X axis (horizontally, along the bottom), I need to be graphed from top to bottom (with the x axis along the left edge).

I've looked at several graphing libraries for this and none seem to support it. I recently discovered Dygraphs so I'm hoping it might have this feature.


Solution

  • While vertical charts are not supported out of the box, it is possible to achieve this effect using CSS transformations. Basically, you rotate the <div> that contains the chart by 90 degrees and undo that transformation for the labels.

    One dygraphs user was able to get this work. See this demo.