java - Apache POI add a Series name into LineChart -


I am creating a LineChart in the Excel document using Apache POI. As far as I have managed to achieve it, it is in the image below:

</

Drawing Questions .createDrawingPatriarch (); Client Anchor Anchor = Drawing. Anchor Anchor (0, 0, 0, 0, 4, 8, 14, 18); Chart chart = drawing. Cut chart (anchor); Chart legend legend = chart.gate operatagent (); Legend.setPosition (LegendPosition.TOP_RIGHT); LineChartData data = charts. GetChartDataFactory (). CreateLineChartData (); Chart Axis Down axis = Chart. Gate Chart Execisfactory (). Create Congress Axis (Exposure.bottom); BottomAxis.setCrosses (AxisCrosses.AUTO_ZERO); ValueAxis leftAxis = chart. GetChartAxisFactory (). CreateVolux (Exxposion. LEFT); LeftAxis.setCrosses (AxisCrosses.AUTO_ZERO); & Lt; ReportQuestionModel & gt; Questionmodels = groupmodel.atata questionmodels (); (Report QuestionsModel QuestionsModel: QModals) {List & lt; Report OptionModel & gt; OptionModels = questionModel.getOptionModels (); (Report Option Model Option Modell: Option Modell) {rowNum ++; XSSFRow Optional = Question. Sikarrao (Row Nom); XSSFCell OptionCell = Option. Open (0); OptionsCell.setCellValue (optionModel.getAnswerText ()); Long Calculation = OptionsModel.getCount (); Kulrespons + = Calculation; XSSFCell OptionContract = VellParau .createCell (1); OptionsCountCell.setCellValue (calculation); XSSFCell Option ChangeGol = VellParau .createCell (2); OptionsPercentageCell.setCellValue (optionModel.getPercentage ()); }} Chartdatasource & lt; Number & gt; Xs = data source. From Numeric Relay (Question, New Selarange Adestor (8, 8, 0, 1)); {Chartdatasource

How can I not find the default "Series 1", "Series 2", ..., "Series N" Taken in the form of my values, from this case: "Answer Options" and the current API does not appear in any manner how to specify the names of the series.

Can anyone help me with it, please?

It was very fast, instead of using:

  Data.addSerie (xs, ys);  

I have to use it:

  lineChartSeries chartarial = data. Adder (xs, ys); ChartSerie.setTitle ("My Title");  

not seen the API which uses data.addSerie (xs, ys); returns a single LineChartSerie object, I can set a title.


Comments