0

I am working with Dojo 1.9.3 and want to have a pie chart fill the space of it's container.

The following jsfiddle shows the chart sized very small due to the label offset. Does anyone know how to keep the label offset (e.g. outside the pie chart) and size the chart more appropriately.

http://jsfiddle.net/a7JLR/89/

var c = new Chart("reportChartDiv");
c.addPlot("default", {
    type: Pie,       
    radius: 40,
    labels: true,
    ticks: false,
    fixed: true,
    precision: 1,
    labelOffset: -30,
    labelStyle: "default",
    htmlLabels: true
});
1
  • I found the same and really need a proper fix for it
    – endamaco
    Commented Jul 18, 2014 at 13:37

2 Answers 2

1

It's about a year old, but I was looking into an unrelated issue I had with the size of a chart so I thought I'd play around with your jsfiddle. I have updated the jsfiddle to make the chart appear bigger.

http://jsfiddle.net/danielkurtz/a7JLR/467/jsf

var c = new Chart("reportChartDiv");
c.addPlot("default", {
    type: Pie,       
    //radius: 40,
    radius: 50,
    labels: true,
    ticks: false,
    fixed: true,
    precision: 1,
    //labelOffset: -30,
    labelOffset: -10,
    //labelStyle: "default",
    labelStyle: "columns",
    htmlLabels: true
});
0

html code

 <div style="position:relative; width:550px;height:250px;border:solid 1px blue;">
  <div id="reportChartDiv" style='position:absolute; width:100%; height:100%;'></div>
 </div>

You can try this code. And adjust your radius, labelOffset, labelStyle parameter.

  var c = new Chart("reportChartDiv");
  c.addPlot("default", {
    type: Pie,       
    radius:120,
    labels: true,
    ticks: false,
    fixed: true,
    precision: 1,
    labelOffset:30,
    labelStyle: "columns",
    htmlLabels: true
  });

Hope it will works fine.

1
  • This is helpful, especially the labelStyle, but I really need the container size to remain what it is in the fiddle.
    – vtforester
    Commented Jul 18, 2014 at 17:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.