问题
I'm having an issue with PHPExcel that it is not PHPExcel's fault. In a graph, the values being presented are very large, so since the default setting for the axis options for Minimum is Automatic, Excel is deciding to use a minimum value for the Y axis of 156,000. The issue can be "Fixed" in Excel by going into the Axis format option and setting a Fixed value of 0 for the minimum of that axis.
So I've been trying to figure out if you can set this option from within PHPExcel, but can't figure out if it's even possible.
So can you change the Chart Axis format options from within PHPExcel, and if so... how?
Thanks,
回答1:
It's an option that isn't yet available with PHPExcel
回答2:
It shall be possible now with this fix: https://github.com/PHPOffice/PHPExcel/commit/1a237573f9127a02388f4e306732122b39d1ea49
Usage example (100 is the max. value):
$axis = new PHPExcel_Chart_Axis();
$axis->setAxisOptionsProperties('nextTo', null, null, null, null, null, null, 100);
$chart = new PHPExcel_Chart('chart' . $locTL, $title, $legend, $pa, true, 0, NULL, NULL, $axis);
I have tested only max limit but I believe it shall function properly for min limit as well.
来源:https://stackoverflow.com/questions/13200770/phpexcel-chart-axis-options-set-minimum