Issue #564 resolved

Metergauge renderer not resizable when replotting.

Anonymous created an issue

When I changed the dimensions of the plot target div ( with .width() and .height()) and I tried to replot the metergauge graph the graph is not fit to the div dimensions.

Comments (4)

  1. Paul Pritchard

    The resize example (http://www.jqplot.com/deploy/dist/examples/resizablePlot.html) shows calling replot with resetAxes: true:

        $('#resizable2').bind('resizestop', function(event, ui) {
            $('#chart2').height($('#resizable2').height()*0.96);
            $('#chart2').width($('#resizable2').width()*0.96);
            plot2.replot({resetAxes:true});
        });
    

    However, since a MeterGauge doesn't have axes, this doesn't work. Instead, it will resize if you pass pretty much any other option, like this:

    $('#resizable2').bind('resizestop', function(event, ui) {
        $('#chart2').height($('#resizable2').height()*0.96);
        $('#chart2').width($('#resizable2').width()*0.96);
        plot2.replot({showTicks: true});
    });
    
  2. Log in to comment