-1

I have been using the fantastic canvas plotting library flot. The selection of graph types is excellent but I want to be able to export the whole graph to an image, including axes numbers, ticks and labels and a the graph title.

Unfortunately only the graph itself seems to be drawn in the canvas, the axes numbers and ticks are in divs. Therefore the canvas toDataURL method does not capture everything.

Can anyone recommend a library with similar functionality which either:

  1. Draws everything within the canvas, or
  2. Has a reliable export to image method

In particular I would like a library which supports the percentiles plot.

Simon Woodhead
  • 561
  • 5
  • 9

1 Answers1

3

Flot 0.8 supports drawing axis labels to canvas using the canvas plugin. I don't know about the chart title - that depends on what plugin or code you're using to do that - but it would be relatively easy to add a draw hook to render that text to canvas.

The only thing Flot can't currently draw to canvas is the legend; that will be added in the next release.

DNS
  • 37,249
  • 18
  • 95
  • 132