i took example from 33chartcreate-pie.php from PHPExcel-1.8 and changing according to my need. now that example have x-axis value like.
$xAxisTickValues1 = array(
new PHPExcel_Chart_DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4), // Q1 to Q4
);
now, i want add it static as PASS and FAIL so, i try it like
$xAxisTickValues1 = array(
new PHPExcel_Chart_DataSeriesValues('String', 'PASS:FAIL', NULL, 2), // Q1 to Q4
);
but, it is not working. how to put static value in that array?
The example which you follow :
$xAxisTickValues1 = array(
new PHPExcel_Chart_DataSeriesValues('String', 'Worksheet!$A$2:$A$5', NULL, 4), // Q1 to Q4
);
Here Worksheet is the title of the sheet. So while plotting graph it will read value from the specified title followed by Columns as A2 to A5.
If you simply want to add static value. Create cell with static content in it and pass the cell index to data series values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With