Hi,
This is my code ( I have underline the line which poses problem).
protected void graphique2(com.aspose.cells.Workbook workbook, int min, int max) throws WriteException, IOException,ParseException,SQLException
{
com.aspose.cells.Font font;
com.aspose.cells.Font font1;
int i =2;
Worksheet sheet1 = workbook.getSheet(0);
Charts charts = sheet1.getCharts();
int index = charts.add(ChartType.LINE,i,6,(i+20),12);
Chart chart = charts.getChart(index);
PlotArea plot = chart.getPlotArea();
plot.setX(20);
plot.setY(20);
Line bd = plot.getBorder();
bd.setVisible(true);
plot.setWidth(3700);
plot.setHeight(3250);
Legend legend = chart.getLegend();
legend.setPosition(LegendPositionType.LEFT);
NSeries serieses = chart.getNSeries();
Title title = chart.getTitle();
ValueAxis valueaxis=chart.getValueAxis();
valueaxis.setCrossAt(100);
serieses.add("$R$"+ min , true);
serieses.setCategoryData("$U$"+min+":$U$"+max);
CategoryAxis axis = chart.getCategoryAxis();
axis.setCategoryType(16);//timescale
axis.setMajorUnitScale(new Short(“1”));//months
ASeries aseries= serieses.get(0);
aseries.setName(""+sheet1.getCell((min-2),17).getStringValue());
aseries.setValues("$V$"+ min +":$V$"+max+"");
aseries.setColorVaried(false);
Area area_a = aseries.getArea();
Line line = aseries.getBorder();
line.setWeight(1);
line.setColor(new Color(0,0,255));
serieses.add("$V$"+ min , true);
CategoryAxis cateAxis2 = chart.getCategoryAxis();
cateAxis2.setCrossAt(0);
com.aspose.cells.Font ftcat2= cateAxis2.getFont();
ftcat2.setSize(7);
ASeries aseries2= serieses.get(1);
aseries2.setName(""+sheet1.getCell((min-2),18).getStringValue());
aseries2.setValues("$W$"+ min +":$W$"+max+"");
aseries2.setColorVaried(false);
line = aseries2.getBorder();
line.setWeight(1);
line.setColor(new Color(0,128,0));
if (indice_2!=null)
{
serieses.add("$V$"+ min , true);
ASeries aseries3= serieses.get(2);
aseries3.setName(""+sheet1.getCell((min-2),19).getStringValue());
aseries3.setValues("$X$"+ min +":$X$"+max+"");
aseries3.setColorVaried(false);
}
/**/
DataLabels dl= aseries.getDataLabels();
com.aspose.cells.Font font_dl = dl.getFont();
font_dl.setSize(7);
dl.setValueShown(false);
title.setText(“Performances 1 an”);
font = title.getFont();
font.setBold(true);
font.setSize(8);
ChartArea chartArea = chart.getChartArea();
Line line2 = chartArea.getBorder();
line2.setVisible(false);
Line majorGridLines = valueaxis.getMajorGridLines();
majorGridLines.setVisible(false);
com.aspose.cells.Font ft= valueaxis.getFont();
ft.setSize(6);
chart.setLegendShown(true);
font1= legend.getFont();
font1.setSize(7);
Area area3 = legend.getArea();
area3.setForegroundColor(new com.aspose.cells.Color(192,192,192));
Line border1=legend.getBorder();
border1.setVisible(false);
}
Thanks
Nadège