2012-08-14 28 views
0

嗨我有一個使用jqPlot生成的餅圖。但是jqPlot區域覆蓋了整個頁面的寬度。我只想在頁面的左半部分顯示。請給我提供一些幫助來做到這一點。 我的代碼如下 -使jqPlot面積更小

var plot2 = jQuery.jqplot ('month_record', [data], 
{ 
    title: "Records saved per month in the previous year", 
    seriesDefaults: { 
    // Make this a pie chart. 
    renderer: jQuery.jqplot.PieRenderer, 
    rendererOptions: { 
     // Put data labels on the pie slices. 
     showDataLabels: true, 
     startAngle:-90, 
     dataLabels: monthRecord, 
     dataLabelFormatString:'%d', 

    } 
    }, 
    legend: { show: true, location: 'e' } 
} 

);

回答

3

jqPlot使用容器的高度/寬度<div>來設置繪圖尺寸。

<div id="chart" style="width: 400px; height: 260px;" class="jqplot-target"> 
    <!-- plot will render here with the above dimensions --> 
</div>