Since resize on chart is not yet supported in 3.4 RC1,
I tried the following link to resize the line chart when the dialog is resized (Showing the chart in a modal dialog)
http://www.jqplot.com/deploy/dist/examp ... ePlot.html
Code: Select all
<p:dialog id="overTheTimeDialog" modal="true" header="Over the time" resizable="true" widgetVar="overTheTime">
<p:lineChart widgetVar="trend" animate="true" zoom="true" id="overTheTimeID" value="#{performanceTrendViewBean.overTheTimeLinearlModel}"
legendPosition="ne" title="Trend over a period of time" xaxisAngle="0" yaxisLabel="Response time in seconds"
xaxisLabel="Date of execution" showMarkers="true"
seriesColors="EF6654,58BE5B,FCD800,4A8CF6,626262,000000,FC00C2,551A8B,FC0000,000CBA,54DDEF,F6B44A,75151A,40FF00,FF9D00,008C04,034030,801C54,E0ADCA,6267A6"
shadow="true"/>
</p:dialog>
Code: Select all
$('#resizableParent').bind('resize', function(event, ui) {
trend.replot( { resetAxes: true } );
});
So i tried another way mentioned in
http://www.jqplot.com/deploy/dist/examp ... yntax.html
getting jqplot plot using jquery data method.
Code: Select all
$('#trendOverID').data('jqplot').replot( { resetAxes: true } );
According to jqplot we can get the plot object from jquery data attribute.
is this a bug in primefaces? or am doing something stupid?
Regards
Sree