Table of Contents

TXlsBaseChart Class

Implements common functionality in an ExcelChart interface for xls or xlsx charts.

Syntax

Unit: FlexCel.XlsAdapter

TXlsBaseChart = class(TRefCountObject, IEmbeddedObjects);

Fields

Name Description
CurrentSheet Identifier of the current sheet.
FDefaultAxisFont Default font for Axis.
FDefaultAxis​Title​Font Default font for the chart axis title.
FDefaultFont Default font.
FDefaultLabelFont Default font for labels.
FDefaultTitleFont Default font for the chart title.
FHorizontalFont​Scaling Horizontal font scaling.
FVerticalFontScaling Vertical font scaling.
Workbook Workbook holding the chart.

Constructors

Name Description
Create You cannot create instances of this class. It must be returned with a call to TXlsFile.GetChart

Methods

Name Description
AddAutoShape Adds an autoshape to an existing embedded chart. Note that the coordinates for the shape are in chart coords, meaning that only row1, row2, col1 and col2 are used, and they represent the percentage in 1/4000 of the coordinate.
So 0 means the top and left of the parent chart, and 4000 means the bottom and right of the parent chart.
AddImage Overloaded
AddImage(TUIImage, IImageProperties)
AddImage(TBytes, IImageProperties)
AddImage(TStream, IImageProperties)
AddImage(string, IImageProperties)
AddImage(TBytes, TXlsImgType, IImageProperties)
AddImage(TStream, TXlsImgType, IImageProperties)
AddImageAlternate Adds an image to the active sheet.
Currently this method is only needed for SVG images, since SVG images are stored as both PNG and SVG inside the xlsx file. This method allows you to supply both images.
CheckConnected Checks if the chart is already loaded.
CheckRange Checks if a parameter is in the range.
CheckRangeObjPath Checks if an ObjPath is in the range.
CheckRangeObj​Path​OrImage​Index Checks that a range or path are between bounds. Internal use.
ClearImage Overloaded
ClearImage(Integer)
ClearImage(Integer, Boolean, string)
DeleteImage Overloaded
DeleteImage(Integer)
DeleteImage(Integer, Boolean, string)
DeleteObject Overloaded
DeleteObject(Integer)
DeleteObject(Integer, string)
DoAfterConstruction This method will be called after the chart has been created.
GetImage Returns an image and its type.
GetImageAlternate Returns an image and its type. Currently this method is the same as 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 GetImage
GetImageProperties Overloaded
GetImageProperties(Integer)
GetImageProperties(Integer, Boolean, string)
GetObjectProperties Returns information on an object and all of its children. If the shape doesn't exist, this method returns null.
GetShapeLinkedCell Returns the cell that is linked to the shape. If the object isn't linked, this method will return null.
Note that when you change the value in the cell linked to this object, the value of the object will change.
HasImageAlternate Returns true if the image has an alternate representation. This currently happens only with SVG images, which have a PNG base and an SVG alternate. If the image has an alternate, you can get the data with GetImageAlternate
ImageIndexTo​Object​Path Returns the absolute object path for an image, given an image index. Note that this method can be slow if there are many objects in the file.
Whenever possible, prefer the methods that take directly an imageIndex instead of converting the imageIndex to an objectPath.
SetObjectText Overloaded
SetObjectText(Integer, string, string)
SetObjectText(Integer, string, TRichString)
SetObjectText(Integer, string, TDrawingRichString)
SetShapeLinkedCell Links the shape to a cell, if the shape can be linked. To unlink the cell, make linkedCell null.
Note that this method applies to shapes like a rectangle or a circle, not to the link of a forms object like a combobox or a radiobutton.

Properties

Name Description
Chart3DOptions Returns the 3D options for the chart, or null if the chart isn't 3D.
ChartOptions Returns the type of chart and the options specific for that kind of chart.
There might be more than one ChartOptions returned, since you can mix more than one type of chart on a simple chart. (One for each series). You need to look at the series ChartOptionsIndex to know to which one it refers.
DefaultAxisFont Returns the default font for the Axis in the chart that do not have a font defined.
DefaultAxisTitleFont Returns the default font for the Axis title in the chart that do not have a font defined.
DefaultFont Returns the default font for all text in the chart that does not have a font defined.
DefaultLabelFont Returns the default font for all labels in the chart that do not have a font defined.
DefaultTitleFont Returns the default font for the Title in the chart that do not have a font defined.
ImageCount The number of images in the chart.
ObjectCount The number of objects that are embedded inside this chart.