3

I want to generate chart using phpspreadsheet library. Below is my requirement that I am not able to fulfill right now using phpspreadsheet.

please check below images and suggest me options for below points.

  1. Want to set position of Data Values to "Below" of points.
  2. Want to remove border from Y-Axis same as Required Output Image.
  3. Want to set Line above X-Axis Labels (6/17,7/17) same as Required Image style.

How can I do that. I have searched whole Chart.php writer file but not found any usefull function.

Help me guys if possible or any other alternate Library also there...

Current Output:

This is I am getting now.

Required Output : I want same like this

Thanks in Advance.

Panda
  • 6,955
  • 6
  • 40
  • 55
Vishal Rambhiya
  • 741
  • 6
  • 10

1 Answers1

0

I have searched lot off and finally got idea, That Chart is XML code and loaded in Excel. So phpspreadsheet is already doing same for chart, phpspreadsheet itself generates xml code.

$objWriter->startElement('c:dLblPos');
$showVal = (empty($chartLayout)) ? 0 : $chartLayout->getShowVal();
$objWriter->writeAttribute('val', 't');
$objWriter->endElement();

We just need to add this lines in Phpspreadsheet/Writer/Xlsx/Chart.php on Line No : 361

Here You can set position of label for values.

"t" : Top

"b" : Below

Thanks

Vishal Rambhiya
  • 741
  • 6
  • 10