如何在PHPEXCEL中将辅助轴设置为数据系列?

时间:2012-10-15 10:09:28

标签: phpexcel

如何为这个系列设置辅助轴?

    $series = new PHPExcel_Chart_DataSeries(
        PHPExcel_Chart_DataSeries::TYPE_LINECHART,      // plotType
        PHPExcel_Chart_DataSeries::GROUPING_CLUSTERED,  // plotGrouping
        $chartOrder,                                    // plotOrder
        $chartLables,                                   // plotLabel
        $chartCategories,                               // plotCategory
        $chartValues                                    // plotValues
    );
    $series->setPlotDirection(PHPExcel_Chart_DataSeries::DIRECTION_COL);
    $plotarea = new PHPExcel_Chart_PlotArea(null, array($series));
    $legend = new PHPExcel_Chart_Legend(PHPExcel_Chart_Legend::POSITION_BOTTOM, null, false);

    $chart = new PHPExcel_Chart(
        "chart_$topRow_$leftColumn",                    // name
        null,                                           // title
        $legend,                                        // legend
        $plotarea,                                      // plotArea
        true,                                           // plotVisibleOnly
        0,                                              // displayBlanksAs
        null,                                           // xAxisLabel
        null                                            // yAxisLabel
    );
    $chart->setTopLeftPosition('A1');
    $chart->setBottomRightPosition(K12');
    $objWorksheet->addChart($chart);

1 个答案:

答案 0 :(得分:0)

你不能,还不支持辅助Y轴....请记住,图表仍然被认为是实验性的,并且图表功能仍在构建中