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

Wednesday, October 5, 2022

[FIXED] How to choose PHPExcel graph type in detail?

 October 05, 2022     excel-2007, php, phpexcel, phpexcel-1.8.0     No comments   

Issue

Following the official example on generating line graph, I am able to create a line graph. However, when I use my own set of data, changing only the data source with all other parts exactly the same as the official example, somehow PHPExcel decide to choose "Stacked line with marker" instead of the "Line with marker".

This is the type of the graph generated. (Stacked line with marker) enter image description here

This is the type I want, the the default type before I change the data. enter image description here

How to set the line graph type in the code?


Solution

Line #93 within the example code you provided at https://github.com/PHPOffice/PHPExcel/blob/1.8/Examples/33chartcreate-line.php is where you change how the plots are grouped.

All you need to do is change it FROM THIS:

PHPExcel_Chart_DataSeries::GROUPING_STACKED

TO THIS:

PHPExcel_Chart_DataSeries::GROUPING_STANDARD

Here is a good resource to find out about the other options for plotting: http://synergica.co/tr/Documentation/API/PHPExcel_Chart/PHPExcel_Chart_DataSeries.html



Answered By - lthrhx
Answer Checked By - Cary Denson (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