Issue #523 resolved

Adding rectangles to Canvas Overlay plugin

Bruno Harbulot
created an issue

I'd like to suggest the ability to use rectangles as well as lines when using the CanvasOverlay plugin. This would be to highlight zones (or durations with a date axis) instead of specific points according to one axis.

A tentative patch that introduces the 'rectangle' type is available here: https://github.com/harbulot/jqplot/commit/36021fb5f04407243a0585e2cfbb3def658fea90

Here is an example page: http://harbulot.github.com/jqplot/canvas_overlay_rectangle/rectangle-overlay.html

It is essentially drawing a rectangle using fillRect, and should use an rgba colour so as to leave the plot visible in the background.

(I think it would be good to be able to do this in the background instead of overlaid, but I wasn't quite sure how to do it.)

Comments and feedback welcome.

Comments (3)

  1. Anonymous

    Thank you so much! it was exactly what I needed and couldn't implement. This is a very necessary feature to show zones on the graph.

  2. Log in to comment