Class MSChartSeries
Represents a MS Chart series wrapper.
Inheritance
Implements
Inherited Members
Namespace: FastReport.MSChart
Assembly: FastReport.dll
Syntax
public class MSChartSeries : Base, IComponent, IDisposable, IFRSerializable
Remarks
This class provides a data for MS Chart series. The series itself is stored inside the MS Chart and is accessible via the SeriesSettings property.
You don't need to create an instance of this class directly. Instead, use the AddSeries(SeriesChartType) method.
Constructors
MSChartSeries()
Creates a new instance of the MSChartSeries class with default settings.
Declaration
public MSChartSeries()
Properties
AutoSeriesColumn
Gets or set the data column or expression for automatically created series.
Declaration
public string AutoSeriesColumn { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
In order to create auto-series, you need to define one series that will be used as a template for new series, and set up the AutoSeriesColumn property. The value of this property will be a name of new series. If there is no series with such name yet, the new series will be added.
AutoSeriesForce
Gets or set Force automatically created series.
Declaration
public bool AutoSeriesForce { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Collect
Gets or sets the collect method used to collect several data points into one.
Declaration
public Collect Collect { get; set; }
Property Value
Type | Description |
---|---|
Collect |
Remarks
This instrument for data processing allows to collect several series points into one point. The collected point will be displaed using the text specified in the CollectedItemText property and color specified in the CollectedItemColor property.
For example, to display top 5 values, set this property to TopN and specify N value (5) in the CollectValue property.
CollectedItemColor
Gets or sets the color for the collected value.
Declaration
public Color CollectedItemColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color |
Remarks
If this property is set to Transparent (by default), the default palette color will be used to display a collected point.
CollectedItemText
Gets or sets the text for the collected value.
Declaration
public string CollectedItemText { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CollectValue
Gets or sets the collect value used to collect several data points into one.
Declaration
public float CollectValue { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
This property is used if the Collect property is set to any value other than None.
Color
Gets or sets the data column or expression that returns the color of data point.
Declaration
public string Color { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Filter
Gets os sets the data filter expression.
Declaration
public string Filter { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
The filter is applied for this series only. You can also use the Filter property to set a filter that will be applied to all series in a chart.
GroupBy
Gets or sets the group method used to group data points.
Declaration
public GroupBy GroupBy { get; set; }
Property Value
Type | Description |
---|---|
GroupBy |
Remarks
This property is mainly used when series is filled with data with several identical X values. In this case, you need to set the property to XValue. All identical data points will be grouped into one point, their Y values will be summarized. You can choose the summary function using the GroupFunction property.
GroupFunction
Gets or sets the function used to group data points.
Declaration
public TotalType GroupFunction { get; set; }
Property Value
Type | Description |
---|---|
TotalType |
GroupInterval
Gets or sets the group interval.
Declaration
public float GroupInterval { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
This value is used if GroupBy property is set to Number.
Label
Gets or sets the data column or expression returns the label value of data point.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PieExplode
Gets or sets the method used to explode values in pie-type series.
Declaration
public PieExplode PieExplode { get; set; }
Property Value
Type | Description |
---|---|
PieExplode |
PieExplodeValue
Gets or sets the value that must be exploded.
Declaration
public string PieExplodeValue { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This property is used if PieExplode property is set to SpecificValue.
Restrictions
This property is not relevant to this class.
Declaration
[Browsable(false)]
public Restrictions Restrictions { get; set; }
Property Value
Type | Description |
---|---|
Restrictions |
SeriesSettings
Gets a reference to MS Chart Series object.
Declaration
public Series SeriesSettings { get; }
Property Value
Type | Description |
---|---|
FastReport.DataVisualization.Charting.Series |
Remarks
Use this property to set many options available for the Series object. These options include: visual appearance, labels, marks, value types. Refer to the Microsoft Chart control documentation to learn more.
SortBy
Gets or sets the sort method used to sort data points.
Declaration
public SortBy SortBy { get; set; }
Property Value
Type | Description |
---|---|
SortBy |
Remarks
You have to specify the SortOrder property as well. Data points in this series will be sorted according selected sort criteria and order.
SortOrder
Gets or sets the sort order used to sort data points.
Declaration
public ChartSortOrder SortOrder { get; set; }
Property Value
Type | Description |
---|---|
ChartSortOrder |
Remarks
You have to specify the SortBy property as well. Data points in this series will be sorted according selected sort criteria and order.
XValue
Gets or sets the data column or expression that returns the X value of data point.
Declaration
public string XValue { get; set; }
Property Value
Type | Description |
---|---|
System.String |
YValue1
Gets or sets the data column or expression that returns the first Y value of data point.
Declaration
public string YValue1 { get; set; }
Property Value
Type | Description |
---|---|
System.String |
YValue2
Gets or sets the data column or expression returns the second Y value of data point.
Declaration
public string YValue2 { get; set; }
Property Value
Type | Description |
---|---|
System.String |
YValue3
Gets or sets the data column or expression returns the third Y value of data point.
Declaration
public string YValue3 { get; set; }
Property Value
Type | Description |
---|---|
System.String |
YValue4
Gets or sets the data column or expression returns the fourth Y value of data point.
Declaration
public string YValue4 { get; set; }
Property Value
Type | Description |
---|---|
System.String |
YValuesPerPoint
Gets a number of Y value per data point.
Declaration
[Browsable(false)]
public int YValuesPerPoint { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
Number of Y values depends on series type. Most of series have only one Y value. Financial series such as Stock and Candlestick, use four Y values.
Methods
AddValue(Object, Object[])
Adds a data point with specified X and Y values.
Declaration
public void AddValue(object xValue, params object[] yValues)
Parameters
Type | Name | Description |
---|---|---|
System.Object | xValue | X value. |
System.Object[] | yValues | Array of Y values. |
Remarks
Note: number of values in the yValues parameter must be the same as value returned by the YValuesPerPoint property.
Assign(Base)
Copies the contents of another, similar object.
Declaration
public override void Assign(Base source)
Parameters
Type | Name | Description |
---|---|---|
Base | source | Source object to copy the contents from. |
Overrides
Remarks
Call Assign to copy the properties from another object of the same type. The standard form of a call to Assign is
destination.Assign(source);
which tells the destination object to copy the contents of the source object to itself. In this method, all child objects are ignored. If you want to copy child objects, use the AssignAll method.
See Also
ClearValues()
Clears all data points in this series.
Declaration
public void ClearValues()
Deserialize(FRReader)
Deserializes the object.
Declaration
public override void Deserialize(FRReader reader)
Parameters
Type | Name | Description |
---|---|---|
FRReader | reader | Reader object. |
Overrides
Remarks
Do not call this method directly. You should override it if you are developing a new component for FastReport.
This method is called when the object needs to restore the state. It may happen when:
- loading the report from a file or stream;
- loading the report from the designer's undo buffer;
- assigning another object to this object using the Assign(Base) or AssignAll methods;
- loading the object from the designer's clipboard;
- loading the object from the preview pages.
GetExpressions()
Gets all expressions contained in the object.
Declaration
public override string[] GetExpressions()
Returns
Type | Description |
---|---|
System.String[] | Array of expressions or null if object contains no expressions. |
Overrides
Remarks
Do not call this method directly. You may override it if you are developing a new component for FastReport.
This method is called by FastReport each time before run a report. FastReport do this to collect all expressions and compile them. For example, GetExpressions method of the TextObject class parses the text and returns all expressions found in the text.
Serialize(FRWriter)
Serializes the object.
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer | Writer object. |
Overrides
Remarks
Do not call this method directly. You should override it if you are developing a new component for FastReport.
This method is called when the object needs to save the state. It may happen when:
- saving the report to the file or stream;
- saving the report to the designer's undo buffer;
- assigning the object to another object using the Assign(Base) or AssignAll methods;
- saving the object to the designer's clipboard;
- saving the object to the preview (when run a report).