EasyXLS™ library allows adding, editing and deleting series from an Excel chart. A chart data source is composed of series that represent the Y axis values. The data of the chart consists of data points that are organized in series.
EasyXLS provides a wide variety of methods that enables users to set multiple series for a chart and their properties like series name, series values and formatting.
The series formatting is formed by fill settings, border color settings, border styles settings, shadow settings and 3D-format, markers settings and data labels settings.
// Set series formatting
xlsChart.easy_getSeriesAt(0).getFillFormat().setBackground(Color.RoyalBlue);
xlsChart.easy_getSeriesAt(1).getFillFormat().setBackground(Color.Yellow);
xlsChart.easy_getSeriesAt(2).getFillFormat().setBackground(Color.LightGreen);
' Set series formatting
xlsChart.easy_getSeriesAt(0).setBackground(Color.RoyalBlue)
xlsChart.easy_getSeriesAt(1).setBackground(Color.Yellow)
xlsChart.easy_getSeriesAt(2).setBackground(Color.LightGreen)
C++// Set series formatting
xlsChart->easy_getSeriesAt(0)->setBackground(COLOR_ROYALBLUE);
xlsChart->easy_getSeriesAt(1)->setBackground(COLOR_YELLOW);
xlsChart->easy_getSeriesAt(2)->setBackground(COLOR_LIGHTGREEN);
Click here to see Continuous Code ListingC++.NET// Set series formatting
xlsChart->easy_getSeriesAt(0)->setBackground(Color::RoyalBlue);
xlsChart->easy_getSeriesAt(1)->setBackground(Color::Yellow);
xlsChart->easy_getSeriesAt(2)->setBackground(Color::LightGreen);
Click here to see Continuous Code Listing
// Set series formatting
xlsChart.easy_getSeriesAt(0).setBackground(Color.blue);
xlsChart.easy_getSeriesAt(1).setBackground(Color.yellow);
xlsChart.easy_getSeriesAt(2).setBackground(Color.green);
.NET:// Set series formatting
$xlsChart->easy_getSeriesAt(0)->setBackground((int)$COLOR_ROYALBLUE);
$xlsChart->easy_getSeriesAt(1)->setBackground((int)$COLOR_YELLOW);
$xlsChart->easy_getSeriesAt(2)->setBackground((int)$COLOR_LIGHTGREEN);
Click here to see Continuous Code ListingJava:// Fomat chart series
$xlsChart->easy_getSeriesAt(0)->getFillFormat()->setBackground(
java("java.awt.Color")->BLUE);
$xlsChart->easy_getSeriesAt(1)->getFillFormat()->setBackground(
java("java.awt.Color")->YELLOW);
$xlsChart->easy_getSeriesAt(2)->getFillFormat()->setBackground(
java("java.awt.Color")->GREEN);
Click here to see Continuous Code Listing
' Set series formatting
xlsChart.easy_getSeriesAt(0).setBackground(CLng(COLOR_ROYALBLUE))
xlsChart.easy_getSeriesAt(1).setBackground(CLng(COLOR_YELLOW))
xlsChart.easy_getSeriesAt(2).setBackground(CLng(COLOR_LIGHTGREEN))
' Set series formatting
xlsChart.easy_getSeriesAt(0).setBackground (CLng(Color.COLOR_ROYALBLUE))
xlsChart.easy_getSeriesAt(1).setBackground (CLng(Color.COLOR_YELLOW))
xlsChart.easy_getSeriesAt(2).setBackground (CLng(Color.COLOR_LIGHTGREEN))
' Set series formatting
xlsChart.easy_getSeriesAt(0).setBackground (CLng(RoyalBlue))
xlsChart.easy_getSeriesAt(1).setBackground (CLng(Yellow))
xlsChart.easy_getSeriesAt(2).setBackground (CLng(LightGreen))
<!-- Set series formatting --><cfset xlsChart.easy_getSeriesAt(0).setBackground(Color.Blue)><cfset xlsChart.easy_getSeriesAt(1).setBackground(Color.Yellow)><cfset xlsChart.easy_getSeriesAt(2).setBackground(Color.Green)>
.NET:# Fomat chart series
xlsChart.easy_getSeriesAt(0).getFillFormat().setBackground(Color.RoyalBlue)
xlsChart.easy_getSeriesAt(1).getFillFormat().setBackground(Color.Yellow)
xlsChart.easy_getSeriesAt(2).getFillFormat().setBackground(Color.LightGreen)
Click here to see Continuous Code ListingJava:# Fomat chart series
xlsChart.easy_getSeriesAt(0).getFillFormat().setBackground(gateway.jvm.Color.blue)
xlsChart.easy_getSeriesAt(1).getFillFormat().setBackground(gateway.jvm.Color.yellow)
xlsChart.easy_getSeriesAt(2).getFillFormat().setBackground(gateway.jvm.Color.green)
Click here to see Continuous Code Listing
The screen shot provides an example of an exported cylinder chart that has the series formatted.
Adding series to chart
The series for Y axis values can be added using ExcelChart.easy_addSeries method. Also, as showed in the above tutorial, the series are automatically built from the data source when the chart sheet is added to the workbook.
EasyXLS lets you set the background appearance of the chart series through the usage of FillDrawingObject.getFillFormat method that is available in ExcelSeries class because of the class inheritance.
The supported fill options are: - No fill - Solid fill (series color, series transparency) - Gradient fill - Picture and texture fill - Automatic
Series border color formatting
EasyXLS lets you set the border color appearance of the chart series through the usage of LineDrawingObject.getLineColorFormat method that is available in ExcelSeries class because of the class inheritance.
The supported border color options are: - No line - Solid line (series line color) - Gradient line - Automatic
Series border style formatting
EasyXLS lets you set the border style of the chart series through the usage of LineDrawingObject.getLineStyleFormat method that is available in ExcelSeries class because of the class inheritance.
The supported border style options are: - Border width - Compound type - Dash type - Cap type - Join type - Arrow settings
Series shadow formatting
EasyXLS lets you set the shadow appearance of the chart series through the usage of LineDrawingObject.getShadowFormat method that is available in ExcelSeries class because of the class inheritance.
The supported shadow options are: - Preset shadows - Shadow color - Transparency, size, blur, angle and distance
Series 3D formatting
EasyXLS lets you set the 3D appearance of the chart series through the usage of EffectDrawingObject.get3DFormat method that is available in ExcelSeries class because of the class inheritance. The 3D option must be used only for the 3D chart types.
The supported 3D options are: - Bevel settings (top and bottom) - Surface settings (material and lighting)
Series markers options
EasyXLS lets you set the marker appearance of the chart series through the usage of ExcelSeries.setMarkerType method. The markers must be used only for the chart types that support markers like line charts, scatter charts or radar charts.
The supported marker options are: - No marker - Built-in marker - Automatic marker - Marker size
Series marker fill formatting
EasyXLS lets you set the background appearance of the series marker through the usage of ExcelSeries.getMarkerFillFormat method. The markers must be used only for the chart types that support markers like line charts, scatter charts or radar charts.
The supported fill options are: - No fill - Solid fill (marker color, marker transparency) - Gradient fill - Picture and texture fill - Automatic
Series marker line color formatting
EasyXLS lets you set the line color appearance of the series marker through the usage of ExcelSeries.getMarkerLineColorFormat method. The markers must be used only for the chart types that support markers like line charts, scatter charts or radar charts.
The supported line color options are: - No line - Solid line (series line color) - Gradient line - Automatic
Series marker line styles formatting
EasyXLS lets you set the line style of the series marker through the usage of ExcelSeries.getMarkerLineStyleFormat method. The markers must be used only for the chart types that support markers like line charts, scatter charts or radar charts.
The supported line style options are: - Line width - Compound type - Dash type - Cap type - Join type - Arrow settings