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

Creating reusable plot objects

We begin to prepare everything for our next chart, but we stop ourselves. Our last two charts for the VPs are bar charts and have very similar options. Several of the charts for the divisional managers could use the same code but with a different data source.

You mention we should DRY up our code. I give you a look. You continue by telling me it means, "Don't Repeat Yourself." I continue to look at you with slight bewilderment. "What?" you say, "I've been reading The Pragmatic Programmer."

This is sound advice. There may be a bit more up-front work to create these objects, but the savings in time and energy for each subsequent chart will be worth it.

We look back at our existing bar charts and distill the most common ...

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