Well, you don't really need to set fashion / saving file format in the new version as by default it is Excel 2003 oriented if the file is XLS. And your understanding is correct.
alg:
2)
Title title = chart.getTitle();
Font font = new Font(); - how I can make a Font ????
title.setFont( font ); - how I can set Font ???
See the sample code.
Title tile = chart.getTitle();
Font font = title.getTextFont();
//Now use the methods of the Font class for your needs
......
//No, need to set the font object back to title now, it is automatically set.
alg:
3) Please, can you ask on this question:
https://forum.aspose.com/t/122578
as I can see:
chart.getNSeries().add("A1:B4", true);
can you explain boolean variable - true? what is it ? isVertical?? Mean?
Can I re-write this code:
Series s1 = nSeries.get( nSeries.add() );
s1.setName( "a" );
s1.setValues( "B1" );
->>> to these:
int nSNum = nSeries.add( "B1", true );
Series s1 = nSeries.get( nSNum );
s1.setName( "a" );
????
The isVertical parameter denotes whether to specify the data source row wise or column wise. For example if your source data is in rectangular shape, e.g A1:B10, A1:A10, A1:C10 etc., then you may use to set it by vertically--> set the isVertical to "true". If your data source (for the series) is spanned on a row, e.g A2:G2, you may set "isVertical" to "false" accordingly. I think for better understanding, you may exercise by yourself by setting "true" and "false" for a single data source (for the data series). For more information an complete reference, check the API Reference for these APIs set to see the examples and details/instructions about the parameters.
now it is not working, but now we need to use: How I can change it in order to make it working ?
int chartIndex = sheet.getCharts().add(ChartType.COLUMN, 9, 9, 21, 15);
this is only one way to create chart now?
Well, I asked you that you should add a chart normally as mentioned by your above line of code. Then get the ChartShape using chart.getChartObject() method, now you may specify your desired attributes using different methods of ChartShape class accordingly.
e.g
int chartIndex = sheet.getCharts().add(ChartType.COLUMN, 9, 9, 21, 15);
Chart chart = sheet.getCharts().get(chartIndex);
ChartShape cshape = chart.getChartObject();
//...........Now use and set your desired attributes.
Please create a Range object as per your desired area. Now, create Style object with your desired style formatting. Lastly, use Range.setStyle() method for your need.
Font font = new Font(); - how
I can make a Font ????
title.setFont( font ); - how
I can set Font ???
Well, you can use Title.getTextFont() to get a Font object and then
setting its properties. Because this Font object belongs to the specific Title
object, modification of the font will effect the title directly. So there is no
need for method Title.setTextFont().
2.
new Color(
color.getRed(),color.getGreen(), color.getBlue() ) ); //
Previous
Methods of Color.getRed()/getGreen()/getBlue() in V7 will return one Color
object represents the pre-defined RED/GREEN/BLUE color. There are also many
other such kind of methods for user’s convenience to get pre-defined colors,
such as Color.getAliceBlue(), Color.getBlack(), ...etc.
The corresponding methods for
Color.getRed()/Color.getGreen()/Color.getBlue() of old versions is
Color.getR()/getG()/getB(), so the method corresponds with new
Color(color.getRed(), color.getGreen(), color.getBlue()) now should be
Color.fromArgb(color.getR(), color.getG(), color.getB()) for versions from V7.
I have noticed that now many method start to throw general exceptions.
For example:
public com.aspose.cells.Picture addPicture(int i, int i1, java.io.InputStream inputStream, int i2, int i3) throws java.lang.Exception { /* compiled code */ }
Previously I have not have any catch for this method?
Please create a Range object as per your desired area. Now, create Style object with your desired style formatting. Lastly, use Range.setStyle() method for your need.
It is not possible to create Range object for me directly:
RangeCollection rangeCollection = new RangeCollection();
Range range = new Range();
Contructors are not public , and not accessible from outside of package.
int chartIndex1 = chartCollection.add( ChartType.COLUMN_3_D_STACKED, 5, 0, 0, 0);
int chartIndex2 = chartCollection.add( ChartType.COLUMN_3_D_STACKED, 5, 7, 0, 0);
charts[0] = chartCollection.get( chartIndex1 );
charts[1] = chartCollection.get( chartIndex2 );
charts[0].getChartObject().setWidth( 400 );
charts[0].getChartObject().setHeight( 300 );
charts[1].getChartObject().setWidth( 400 );
charts[1].getChartObject().setHeight( 300 );
Can I make it a lttile bit more simple? especcialy with ChartObject.
Well, I am afraid you have to do it now in order to accomplish the task. These APIs e.g ChartShape is equally matched with .NET version's class which has the same attributes/properties as these are in Java version.