How to change/update the renderer

703 views
Skip to first unread message

Daniel Valencia

unread,
Aug 6, 2009, 4:06:22 PM8/6/09
to jqplot-users
I'm trying to update the renderer dynamically in a plot. I tried with
this:

plot.seriesDefaults.renderer = $.jqplot.BarRenderer;
plot.redraw(); // err

plot.series[0].renderer = $.jqplot.BarRenderer;
plot.redraw(); // err: this.renderer.setGridData is undefined

any ideas ?

thanks in advance.

--
daniel

Ralph Bean

unread,
Aug 6, 2009, 4:33:24 PM8/6/09
to jqplot...@googlegroups.com
Try
  plot.series[0].renderer = $.jqplot.BarRenderer();
In jqPlot.init(),
  renderer=renderer()
happens at some point.
-Ralph

Chris Leonello

unread,
Aug 7, 2009, 10:32:34 AM8/7/09
to jqplot...@googlegroups.com
Changing the renderer will require re-initialization of the plot in
many cases. Re-drawing doesn't do any initialization, so you'll
probably have to recreate the plot from scratch with another call to
$.jqplot() and passing in the new renderer in the options object
argument.

--
Chris Leonello
Reply all
Reply to author
Forward
0 new messages