How to create line charts on the basis of percentage using phpexcel

Topics: Developer Forum
May 5, 2014 at 12:45 PM
Edited May 6, 2014 at 5:01 AM
I want Y axises label start from 30% to 100%.
and i am trying using below array but m not getting correct output.
is it right way to adding percentage in array.
e:g
$dataArray=array(
array('Q3', 'Mar', ' Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan','Feb'),

array('Y(%)','4.9%', '7.1%','8.3%', '9.3%',55.9%', '51.0%', '81.2%', '79.8%', '78.4%','73.4%','77.7%', '78.1%'),

array('Y(%)', '80.5%', '78.8%', '80.5%', '78.7%', '77.1%', '71.0%', '76.5%', '74.3%', '77.7%', '80.2%', '78.1%', '77.9%'),
Coordinator
May 5, 2014 at 3:16 PM
Charts don't work with strings: and a % sign means that this is a string. Don't store a % as part of the value; store simply the numeric value.
May 6, 2014 at 7:52 AM
Edited May 6, 2014 at 7:55 AM
I need below values as it in excel sheet each cells can u please assist me?

And for Y axises label start from 30% to 100% in line chart.

Q3 Mar Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb

CY(%) 74.9% 74.1% 81.3% 80.3% 75.9% 71.0% 81.2% 79.8% 78.4% 73.4% 77.7% 78.1%

'PY(%)', '80.5%', '78.8%', '80.5%', '78.7%', '77.1%', '71.0%', '76.5%', '74.3%', '77.7%', '80.2%', '78.1%', '77.9%'
Coordinator
May 6, 2014 at 8:07 AM
Edited May 6, 2014 at 8:08 AM
I don't know where your data is coming from, but your Excel sheet needs to use format masking to show percentages, not to use a % as part of a string value. The cell values should be straight numeric values, not strings.
May 6, 2014 at 10:04 AM
Edited May 7, 2014 at 5:49 AM
actually currently i was added dummy values.
and now i am trying to add multi tab sheet means want to set title for each sheet and when i am adding the title as below

e:g: $phpExcel->getActiveSheet()->setTitle("My Sheet");
then the linechart is not working properly their lines are going to bottom of chart why ?