EasyXLS™ library allows setting the formatting properties for the chart legend of an Excel file.
EasyXLS provides a wide variety of methods that enables users to set the chart legend and its properties like legend position, keys arrangement direction and formatting.
The chart legend formatting is formed by font settings, fill settings, border styles settings, border color settings and shadow settings.
.NET:# Format chart legend
xlsChartLegend = xlsChart.easy_getLegend()
xlsChartLegend.getFillFormat().setBackground(Color.LavenderBlush)
xlsChartLegend.getFontFormat().setForeground(Color.Blue)
xlsChartLegend.getFontFormat().setItalic(True)
xlsChartLegend.setKeysArrangementDirection(Chart.KEYS_ARRANGEMENT_DIRECTION_HORIZONTAL)
xlsChartLegend.setPlacement(Chart.LEGEND_CORNER)
xlsChartLegend.getShadowFormat().setShadow(ShadowFormat.OFFSET_DIAGONAL_BOTTOM_RIGHT)
Click here to see Continuous Code ListingJava:# Format chart legend
xlsChartLegend = xlsChart.easy_getLegend()
xlsChartLegend.getFillFormat().setBackground(gateway.jvm.Color.pink)
xlsChartLegend.getFontFormat().setForeground(gateway.jvm.Color.blue)
xlsChartLegend.getFontFormat().setItalic(True)
xlsChartLegend.setKeysArrangementDirection(gateway.jvm.Chart.KEYS_ARRANGEMENT_DIRECTION_HORIZONTAL)
xlsChartLegend.setPlacement(gateway.jvm.Chart.LEGEND_CORNER)
xlsChartLegend.getShadowFormat().setShadow(gateway.jvm.ShadowFormat.OFFSET_DIAGONAL_BOTTOM_RIGHT)
Click here to see Continuous Code Listing
The screen shot provides an example of an exported cylinder chart and the chart legend is formatted: background (lavender blush), foreground (blue), italic font, legend position (corner) and shadow.
EasyXLS allows you to set the font appearance of the chart legend through the usage of FontDrawingObject.getFontFormat method that is available in ExcelChartLegend class because of the class inheritance.
The supported font settings are: - Font name - Font style (bold, italic, regular) - Font size - Font color - Font underline style - Font effect (strikethrough, superscript, subscript, offset, small caps)
Chart legend fill formatting
EasyXLS allows you set the background appearance of the chart legend through the usage of FillDrawingObject.getFillFormat method that is available in ExcelChartLegend class because of the class inheritance.
The supported fill options are: - No fill - Solid fill (chart legend color, chart legend transparency) - Gradient fill - Picture and texture fill - Automatic
Chart legend border color formatting
EasyXLS allows you set the border color appearance of the chart legend through the usage of LineDrawingObject.getLineColorFormat method that is available in ExcelChartLegend class because of the class inheritance.
The supported border color options are: - No line - Solid line (chart legend line color, chart legend transparency) - Gradient line - Automatic
The supported border style options are: - Border width - Compound type - Dash type - Cap type - Join type
Chart legend shadow formatting
EasyXLS allows you set the shadow appearance of the chart legend through the usage of LineDrawingObject.getShadowFormat method that is available in ExcelChartLegend class because of the class inheritance.
The supported shadow options are: - Preset shadows - Shadow color - Transparency, size, blur, angle and distance