Table of Contents

TXlsChart Class

Implements an ExcelChart interface for charts in xls files.

Syntax

Unit: FlexCel.XlsAdapter

TXlsChart = class(TXlsBaseChart, IExcelChart);

Methods

Name Description
AddSeries Adds a series to the chart.
AddSubchart Adds a new subchart to the existing chart. Note that if the current active subchart is empty, this method will not add a new subchart, but replace the empty one. In that case, IExcelChart.​Subchart​Count won't change.

This method only works in xlsx files, not xls.
DeleteObject Overloaded
DeleteObject(Integer)
DeleteObject(Integer, string)
DeleteSeries Deletes the series at position index.
GetBubbleSeries Returns the bubble definition for a series when in a bubble chart.
GetChartAxis Returns the axis information for this chart. Note that this might be more than one, if the chart has a secondary axis.
GetChartLegend Information about the Legend of the chart.
GetDataLabels Returns all the labels for the chart. Note that Axis have their labels defined inside their own definition.
GetDataLabelsRange Returns the range of cells for a "Label Contains: " "Value from Cells" option in the labels.
Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.
GetImage Returns an image and its type.
GetImageAlternate Returns an image and its type. Currently this method is the same as TXlsBaseChart.​Get​Image for all images except SVG.
For SVG images, xlsx files store both a PNG and SVG image. In those cases, this method will return the SVG image. To get the PNG, call TXlsBaseChart.​Get​Image
GetObjectProperties Returns information on an object and all of its children. If the shape doesn't exist, this method returns null.
GetSeries Returns a series definition.
GetSeriesInSubchart Returns a series definition for a given subchart. Note: This method only works in xlsx files.
GetTitle Returns the title of the chart.
GetTrendline Gets a trendline for a chart. This method is only implemented for xlsx charts.
RemoveChartLegend Removes the Legend from the chart.
SetBubbleSeries Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
SetChartAxis Sets the options for either the primary or secondary pair of axis.
SetChartLegend Sets the legend properties.
SetChartOptions Sets the chart options of a specific subchart inside the chart. Note that while a chart can have multiple subcharts inside (for example one pie subchart and one line subchart), normally there is only one subchart and so the SubchartPos parameter is normally 1.
SetDataLabels Changes the labels for the chart. You should always get the values with IExcelChart.​Get​Data​Labels, modify them, and change them back with this method.
SetDataLabelsRange Sets the range of cells for a "Label Contains: " "Value from Cells" option in the labels.
Note that for this to work, you also need to use the string [CELLRANGE] in the label definition.
SetObjectText Overloaded
SetObjectText(Integer, string, string)
SetObjectText(Integer, string, TRichString)
SetObjectText(Integer, string, TDrawingRichString)
SetSeries Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
SetSeriesInSubchart Sets a Series value. Note that for xlsx charts, this will change the **data range** and the **options** of the series. If you only want to change the data range, pass null options to the method.
SetTitle Sets the title of the chart. This method is only implemented for xlsx charts.
SetTrendline Gets a trendline for a chart. This method is only implemented for xlsx charts.

Properties

Name Description
Background Returns the chart background if there is one defined, or null if there is none.
BackWall The wall at the back of a 3D-chart
Chart3DOptions Returns the 3D options for the chart, or null if the chart isn't 3D.
Floor The floor in a 3D-chart.
IsXlsxChart Returns true if the chart is defined inside an xlsx file instead of xls. While both charts in xls and xlsx files are mostly compatible, some behaviors can change depending on what type of chart this is. For example, if the first series in an xls chart is pie, it won't draw gridlines even if the second isn't. In xlsx charts, if another series is not pie, Excel will draw the gridlines.
ObjectCount The number of objects that are embedded inside this chart.
PlotArea Returns or sets the plot area definition for the chart. Note: Setting the plot area only works in xlsx files.
PlotEmptyCells Defines how null cells will be plotted on the chart.
SeriesCount Returns the count of series on this chart.
ShowDataInHidden​Rows​AndCols Defines if hidden rows and columns will be used when plotting values.
SideWall The wall next to the y-axis in a 3D-chart.
Style This is a number between 1 and 48 which defines many standard properties for the chart, like the default line width for the series or the legend.
The default style is 2.
SubchartCount A chart can have multiple subcharts inside: For example one bar chart and one pie chart.
This method returns how many subcharts you have inside the main chart. Note that this property only works in xlsx files: In xls files it will always return 1.