Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jqPlot graph in accordion

I want to plot a graph within a jQuery accordion but it causes the graph to chopped and the scales to be displayed. Anyone got a fix for this?

like image 898
teddyboy Avatar asked Dec 30 '22 11:12

teddyboy


1 Answers

As explained on jqPlot's Tab and Accordion UI Widgets page, jqPlot needs to know the size of the chart when it's plotted, and it can't do that if the chart is hidden by an accordion or tab. The solution is to either specify the chart's dimensions in an alternate fashion or to call replot when the accordion is expanded. See Tab and Accordion UI Widgets for full details and example code.

like image 160
Josh Kelley Avatar answered Dec 31 '22 23:12

Josh Kelley