【问题标题】:PhpSpreadsheet: How to change plotStyle and other optionsPhpSpreadsheet:如何更改 plotStyle 和其他选项
【发布时间】:2020-03-31 18:58:28
【问题描述】:

我想在我的 xlsx 电子表格中自定义 ScatterPlot 图表。我已使用 PhpSpreadsheet 的示例 ScatterPlot 代码开始。对示例代码的一项小修改是将新的 Chart displayBlanksAs 参数从 0 更改为“gap”。这是示例代码中的已知错误:

File containing a chart can not be opened by Excel 2003/2013/2019

33_Chart_create_scatter.php

我有很多问题,但我会问几个,然后也许我可以弄清楚其余的。

问题 #1: 如何将 ScatterPlot plotStyle 从 Line & Marker 更改为仅标记?我以为我可以将它从 DataSeries::STYLE_LINEMARKER 更改为 DataSeries::STYLE_MARKER。但这并没有改变什么。

        $series = new DataSeries(
             DataSeries::TYPE_SCATTERCHART,
             null,
             range(0, count($dataSeriesValues) - 1),
             $dataSeriesLabels,
             $xAxisTickValues,
             $dataSeriesValues,
             null,
             null,
             DataSeries::STYLE_LINEMARKER // Can I change to STYLE_MARKER?
         );

问题 #2:。如何删除 yAxis 水平主网格线?

【问题讨论】:

标签: phpspreadsheet


【解决方案1】:

好的,我花了一整天的时间来追踪 OpenXml 数据,并找到了回答问题 #1 所需的更改。

This is how I debugged the xlsx

Here is how I modified PhpSpreadsheet to fix it

我会尝试提交一个拉取请求,一旦我能记住该怎么做。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-05
    • 1970-01-01
    • 2014-05-25
    • 1970-01-01
    • 2021-09-25
    • 1970-01-01
    相关资源
    最近更新 更多