Som Sarkar
Som Sarkar

Reputation: 289

Making the jqPlot area smaller

Hi I have got a pie chart which is generated using jqPlot. But the jqPlot area is covering the whole width of the page. I want to show that only at the left half of the page. Can any on please provide me a little help to do this. My code is given below-

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' }
}

);

Upvotes: 0

Views: 793

Answers (1)

Mark
Mark

Reputation: 108567

jqPlot uses the height/width of the container <div> to set the plot dimensions.

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

Upvotes: 3

Related Questions