Forum


Replies: 17   Views: 3282
Line chart - labels missing
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by martin@myprofitsee.com  · 06-12-2012 - 00:48

Hi everybody,

I was taking the example from the download to generate a line chart. However, I am not getting any labels on the X-Axis. Can anyone help me out there? (When I create a sample report online, with the 3 bars, I can see the labels).

$lineChartValues = array(
'legend' => array('SymbianOS','iOS','BlackBerry OS','Android', 'Sony Ericsson','Samsung','Other'),
'2010-05' => array('32.92', '29.01', '14.15', '3.94', '9.09', '2.86', '1.11'),
'2010-06' => array('33.39', '26.66', '14.98', '3.95', '9.81', '3.34', '1.07'),
'2010-07' => array('32.04', '26.05', '16.45', '7.91', '6.77', '2.93', '1.46'),
'2010-08' => array('31.54', '25.71', '16.95', '9.22', '6.16', '2.85', '1.43'),
'2010-09' => array('32.69', '22.85', '17.9', '9.79', '6.59', '2.96', '1.16'));

$paramsChart = array(
'data' => $lineChartValues,
'type' => 'lineChart',
'title' => 'Top 7 Mobile OSs from May 2010 to May 2011',
'color' => 2,
'sizeX' => 15,
'sizeY' => 15,
'jc' => 'center',
'groupBar' => 'clustered',
'font' => 'Arial',
'legendpos' => 'b',
'legendoverlay' => 0,
'hgrid' => 0,
'vgrid' => 0
);

$docx->addTemplateChart('CHART_1', $paramsChart);

Thanks,
Martin

Posted by martin@myprofitsee.com  · 11-04-2013 - 12:13

Strangely enough, I found that the difference is in using addChart() vs. addTemplate Chart().

A more detailed example:

$colChartValues = array(
'legend' => array('Internet Explorer'),
'January 2011' => array('26.6'),
'February 2011' => array('26.5'),
'March 2011' => array('25.8'),
'April 2011' => array('24.3'),
'May 2011' => array('24.9'),
'June 2011' => array('23.2')
);

$paramsChart = array(
'data' => $colChartValues,
'type' => 'barChart',
'title' => 'W3C Browser Statistics',
'color' => 2,
'sizeX' => 15,
'sizeY' => 15,
'jc' => 'center',

);

//$docx->addTemplateChart('CHART', $currentRatioChart); DOES NOT WORK
//$docx->addChart($currentRatioChart); WORKS


Why are those two methods resulting in different charts?

Screenshot 1 shows it when it was added to a template, which contained nothing else but the text $CHART$
Screenshot 2 shows the Chart added in a new docx document

http://imgur.com/sdXBv

Posted by admin  · 11-04-2013 - 12:13

Hello,

The next version of phpdocx that we hope to release this month we'll add several improvements to charts and we'll solve this issue. The different when creating a new DOCX and using a template was due to a parallel development.

Regards.

Posted by martin@myprofitsee.com  · 11-04-2013 - 12:13

Hi,

could I have a beta version of this release already? We need to release our Word Report this week, but this is a major roadblock which stops us from releasing.
Or any hotfix would do as well for the meanwhile.

Thanks,
Martin

Posted by admin  · 11-04-2013 - 12:13

Hello,

Sorry but we're in dev stage and you'd find several errors if we send you a beta file.

Regards.

Posted by martin@myprofitsee.com  · 11-04-2013 - 12:13

Ok I see. What's the scheduled date for the upcoming release?

Thanks,
Martin

Posted by martin@myprofitsee.com  · 11-04-2013 - 12:13

Any update on the release date?

Posted by admin  · 11-04-2013 - 12:13

Hello,

We are in test stage, I hope to contact you the next wednesday by email.

Regards.

Posted by martin@myprofitsee.com  · 11-04-2013 - 12:13

Ok cool, really looking forward to that so we can release our app later this wekk.
Thanks

Posted by admin  · 11-04-2013 - 12:13

Hello,

Yesterday was released phpdocx 3.0. You can download your package in MYPHPDOCX page after login.

Regards.

Posted by martin@myprofitsee.com  · 11-04-2013 - 12:13

I downloaded V3.0, but still run into the same issues.

Can you verify that my above posted issue is resolved when you test it? We want to release our software this week, so this is really urgent thanks,

Martin

Posted by admin  · 11-04-2013 - 12:13

Hello,

We're checking your issue, it should be solved using the new version. You'll have an answer ASAP

Regards.

Posted by admin  · 11-04-2013 - 12:13

Hello,

I've done some test and I see everything working fine using the new version. Please contact us http://www.phpdocx.com/contact to see what's happening.

Regards.

Posted by martin@myprofitsee.com  · 11-04-2013 - 12:13

Can you send me your template doc and code, and the result docx, so I can test this on my side as well.
email martinosaint at yahoo.com
thx

Posted by admin  · 11-04-2013 - 12:13

Hello,

We have sent you the documents and the script.

Regards.

Posted by martin@myprofitsee.com  · 11-04-2013 - 12:13

Hi,

thanks! So it works if I use your doc template. However, if I open it and save it in on my Machine (Mac + Word2012), then the template seems to become corrupted and the same issue occurs again.

So there seems to be some compatibility issue with Mac Word. On Windows it works fine.

Thanks
Martin

Posted by admin  · 11-04-2013 - 12:13

Hi,

I have added your issue to review. It should work fine in Mac OS X too, but we'll check and solve it.

Regareds.