TXlsChart Class
Implements an ExcelChart interface for charts in xls files.
Syntax
Unit: FlexCel.XlsAdapter
TXlsChart = class(TXlsBaseChart, IExcelChart);
Methods
Name | Description |
---|---|
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.SubchartCount won't change. This method only works in xlsx files, not xls. |
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. |
AddSeries | Adds a series to the chart. |
DeleteSeries | Deletes the series at position index. |
GetSeries | Returns a series definition. |
GetSeriesInSubchart | Returns a series definition for a given subchart. Note: This method only works in xlsx files. |
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. |
GetBubbleSeries | Returns the bubble definition for a series when in a bubble 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. |
GetChartAxis | Returns the axis information for this chart. Note that this might be more than one, if the chart has a secondary axis. |
SetChartAxis | Sets the options for either the primary or secondary pair of axis. |
GetDataLabels | Returns all the labels for the chart. Note that Axis have their labels defined inside their own definition. |
SetDataLabels | Changes the labels for the chart. You should always get the values with IExcelChart.GetDataLabels, modify them, and change them back with this method. |
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. |
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. |
GetTitle | Returns the title of the chart. |
SetTitle | Sets the title of the chart. This method is only implemented for xlsx charts. |
GetChartLegend | Information about the Legend of the chart. |
SetChartLegend | Sets the legend properties. |
RemoveChartLegend | Removes the Legend from the chart. |
GetTrendline | Gets a trendline for a chart. This method is only implemented for xlsx charts. |
SetTrendline | Gets a trendline for a chart. This method is only implemented for xlsx charts. |
GetObjectProperties | Returns information on an object and all of its children. If the shape doesn't exist, this method returns null. |
SetObjectText | Overloaded SetObjectText(Integer, string, string) SetObjectText(Integer, string, TRichString) SetObjectText(Integer, string, TDrawingRichString) |
DeleteObject | Overloaded DeleteObject(Integer) DeleteObject(Integer, string) |
GetImage | Returns an image and its type. |
GetImageAlternate | Returns an image and its type. Currently this method is the same as TXlsBaseChart.GetImage 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.GetImage |
Properties
Name | Description |
---|---|
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. |
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. |
Background | Returns the chart background if there is one defined, or null if there is none. |
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. |
ShowDataInHiddenRowsAndCols | Defines if hidden rows and columns will be used when plotting values. |
Chart3DOptions | Returns the 3D options for the chart, or null if the chart isn't 3D. |
Floor | The floor in a 3D-chart. |
SideWall | The wall next to the y-axis in a 3D-chart. |
BackWall | The wall at the back of a 3D-chart |
SeriesCount | Returns the count of series on this chart. |
ObjectCount | The number of objects that are embedded inside this chart. |