Class SparklineObject
Represents the small chart object (called sparkline) fully based on MSChartObject.
Inheritance
Inherited Members
Namespace: FastReport.MSChart
Assembly: FastReport.dll
Syntax
public class SparklineObject : MSChartObject, IComponent, IDisposable, IFRSerializable, IHasEditor, IParent
Constructors
SparklineObject()
Initializes a new instance of the SparklineObject with default settings.
Declaration
public SparklineObject()
Methods
GetPreferredSize()
Gets the preferred size of an object.
Declaration
public override SizeF GetPreferredSize()
Returns
Type | Description |
---|---|
System.Drawing.SizeF | Preferred size. |
Overrides
Remarks
This method is called by the FastReport designer when you insert a new object.
OnBeforeInsert(Int32)
Called before inserting a new object in the designer.
Declaration
public override void OnBeforeInsert(int flags)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | flags | Object's flags. |
Overrides
Remarks
Do not call this method directly. You may override it if you are developing a new component for FastReport.
Some objects are registered in the designer several times with the same object type, but different flags. For example, the ShapeObject represents different shapes: rectangle, roundrect, ellipse and so on. All these shapes are registered in the designer using flags (the last parameter in this code):
RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 108, "Objects,Shapes,Rectangle", 0);
RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 109, "Objects,Shapes,RoundRectangle", 1);
RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 110, "Objects,Shapes,Ellipse", 2);
When we put the "Ellipse" object on a band, the designer creates the ShapeObject instance and calls its OnBeforeInsert method with flags value set to 2. In turn, the OnBeforeInsert method converts the int value of the flags to the shape kind:
public override void OnBeforeInsert(int flags)
{
FShape = (ShapeKind)flags;
}