PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, October 4, 2022

[FIXED] how to send worksheet data static in PHPExcel chart

 October 04, 2022     php, phpexcel     No comments   

Issue

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?


Solution

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.



Answered By - rajatsaurastri
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing