Hi,
I think, it is a good approach and saves your lines, one font object for all of the chart objects, but you need to test it though.
1)
worksheet.getShapes().addTextBox(10,11,12,13,14,15);
Now should be:
worksheet.getShapes().addShape(MsoDrawingType.TEXT_BOX,10, 12, 11, 13, 15, 14);
Please pay more attention to the change of parameters order from old to new versions.
2)
textBox.getLine().setVisible( false );
textBox.setContent( title );
Now should be:
textBox.getFillFormat().setVisible(false);
textBox.getLineFormat().setVisible(false)
textBox.setText(title);
3)
pageSetup.setLeftHeader( header );
pageSetup.setDifferentFirstPage( true );
pageSetup.setsetCenterFooter( footer );
Now should be:
pageSetup.setHeader(0, header);
pageSetup.setHFDiffFirst(true);
pageSetup.setFooter(1, footer);
aStyle.setBorderColor( BorderType.BOTTOM_BORDER, convertToAsposeColor( borderColorBottom ) );
aStyle.setColor( Color.fromArgb( color.getRed(),color.getGreen(),color.getBlue() ) );
Now please use following APIs:
style.getBorders().getByBorderType(BorderType.TOP_BORDER)
Border.setLineStyle()/setColor()
Or
Style.setBorder(borderType, borderStyle, borderColor)
5)
datalabels.setLabelPosition()
Now should be:
DataLabels.setPosition()
6)
SortOrderType.DESCENDING
Now changed to
SortOrder.DESCENDING
7)
worksheets.moveSheet( worksheets.get( STATISTICS_SHEET_NAME ).getIndex(), 1 );
Now should be:
worksheets.get(STATISTICS_SHEET_NAME).move(1);
8)
Workbook.loadData(...)
Please use
LoadOptions by setLoadDataOnly(true)
For the code of apply same font to multiple components, I don’t think your code will take effect. In Java language, assigning a new value to a local variable will not effect other objects that used the variable previously. To simplify your code a bit, we think you can create a method to custom the font, code like following:
setChartFont(chart.getChartDataTable().getFont());
setChartFont(chart.getChartArea().getTextFont());
setChartFont(chart.getLegend().getTextFont());
private void setChartFont(Font font)
{
font.setName("Segou UI");
font.setSize(9);
}
Hi,
1) Yes, please cast it.
2) Please use chart.getNSeries().get(0).getDataLabels();
3) Yes, it is now VerticalPageBreak
4) Use
Style st=cell.getStyle();
st.getFont().setColor(arg0);
5) It’s strange, I don’t chart.getValueAxis().getArea(), we will implement it.
6) You will now just use constructor i.e
String filePath = “c:\yourfile.xlsx”;
Workbook workbook = new Workbook(filePath);
You don’t need to specify its extension.
7) I find, you can set it using ch.getNSeries().setSecondCatergoryData() method.
Please see the following more correct ways.
4) Style.setColor()
style.setPattern(BackgroundType.SOLID);
If you want to specify the file format when opening a template file, please use LoadOptions, code like following:
now is:
workbook.setFileFormat(FileFormatType.EXCEL_97_TO_2003);
Hello,
Hi,
For your requirement about Axis.getArea():
We are afraid even in old versions setting the area of Axis is not supported yet. In old versions Axis.getArea() is only an empty API without implementation. Setting properties for the returned Area object does not take effect for the Chart.
For the new version, we will add such a method in later versions when we can support to set and save user’s settings for the area object of chart Axis. But we are afraid we need more time to support this feature after some other important tasks.