birmas

Pie Chart labels are offset incorrectly

Recommended Posts

I am using a Pie3D chart rendered with javascript. As you can see from the images - one of them has labels incorrectly aligned with the chart.

 

The ONLY difference between the two is that the faulty one is loaded in a hidden div (display: none;) and shown using $('#divID').toggle('show');

 
How can I resolve this issue? The charts do not have the same impact without the text labels. Can I force the chart to re-render after I have called the show() command?
 

The PHP code I am using is:

FC_SetDataFormat("json");
FC_SetRenderer('javascript');
$sub_chart = renderChart("./includes/Charts/Pie3D.swf", "", $subJSON, 'tag_'.$id_tag, '700', '300', '1', '1');

The JSON I am using is:

    "chart": {
        "caption": "ZAP Orientation - By Role",
        "formatnumberscale": "0",
    },
    "data": [{
              "label": "Steel Fixer",
              "value": "6",
              },{
              "label": "Concrete Finisher",
              "value": "3",
              },{
              "label": "Safety Administrator",
              "value": "1",
              },{
              "label": "Administrator",
              "value": "1",
              },{
              "label": "Supervisor",
              "value": "2",
              },{
              "label": "Engineer",
              "value": "1",
              },{
              "label": "Environmental Advisor",
              "value": "1",
              },{
              "label": "Safety Advisor",
              "value": "1",
              },{
              "label": "HSE Manager",
              "value": "2",
              },{
              "label": "Surveyor",
              "value": "1",
              },{
              "label": "Project Engineer",
              "value": "1",
              },{
              "label": "Civil Labourer",
              "value": "1",
              }]

post-62366-0-37902600-1389156485_thumb.png

post-62366-0-37115400-1389156487_thumb.png

Share this post


Link to post
Share on other sites

Hey,

 

Apologies for the delayed response.

 

Can you please try specifying the chart dimension in percentage for the chart rendered within hidden container?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now