Apache POI add a Series name into LineChart

前端 未结 2 738
情深已故
情深已故 2020-11-28 16:16

I am creating a LineChart using Apache POI in Excel document. As far as I\'ve managed to achieve is in the below image:

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 17:01

    It was pretty straight forward, just instead of using:

    data.addSeries(xs, ys);
    

    I had to be using:

    LineChartSeries chartSeries = data.addSeries(xs, ys);
    chartSeries.setTitle("My Title");
    

    Didn't look at the API that using data.addSeries(xs, ys); returns a single LineChartSeries object onto which I can set a title.

提交回复
热议问题