O'Reilly logo

Learning jqPlot by Scott Gottreu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Canvas versus CSS

jqPlot uses a combination of HTML styled by CSS and canvas elements added to the HTML. Canvas elements are created using JavaScript and jqPlot simplifies the creation of these canvas elements. When it creates a plot, it creates several different canvas elements. A separate canvas element is created for each series along with an element for the grid. If our lines or bars have shadows, there is an element for each shadow. Also, if we use the canvas renderers for our ticks or labels, those are created as canvas elements.

In the past, we modified the default jqPlot CSS styles for our legend, tooltips, and ticks. This is thanks to jqPlot creating divs or tables that we can alter using CSS styling. However, with canvas elements, the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required