Aspose::Cells::Charts::Series class
Contents
[
Hide
]Series class
Encapsulates the object that represents a single data series in a chart.
class Series
Methods
Method | Description |
---|---|
GetArea() | Represents the background area of Series object. |
GetBar3DShapeType() | Gets or sets the 3D shape type used with the 3-D bar or column chart. |
GetBorder() | Represents border of Series object. |
GetBubbleScale() | Gets or sets the scale factor for bubbles in the specified chart group. It can be an integer value from 0 (zero) to 300, corresponding to a percentage of the default size. Applies only to bubble charts. |
GetBubbleSizes() | Gets or sets the bubble sizes values of the chart series. |
GetCountOfDataValues() | Gets the number of the data values. |
GetDataLabels() | Represents the DataLabels object for the specified ASeries. |
GetDisplayName() | Gets the series’s name that displays on the chart graph. |
GetDoughnutHoleSize() | Returns or sets the size of the hole in a doughnut chart group. The hole size is expressed as a percentage of the chart size, between 10 and 90 percent. |
GetDownBars() | Returns a DropBars object that represents the down bars on a line chart. Applies only to line charts. |
GetDropLines() | Returns a Line object that represents the drop lines for a series on the line chart or area chart. Applies only to line chart or area charts. |
GetExplosion() | The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter. |
GetFirstSliceAngle() | Gets or sets the angle of the first pie-chart or doughnut-chart slice, in degrees (clockwise from vertical). Applies only to pie, 3-D pie, and doughnut charts, 0 to 360. |
GetGapWidth() | Returns or sets the space between bar or column clusters, as a percentage of the bar or column width. The value of this property must be between 0 and 500. |
GetHas3DEffect() | True if the series has a three-dimensional appearance. Applies only to bubble charts. |
GetHasDropLines() | True if the chart has drop lines. Applies only to line chart or area charts. |
GetHasHiLoLines() | True if the line chart has high-low lines. Applies only to line charts. |
GetHasLeaderLines() | True if the series has leader lines. |
GetHasRadarAxisLabels() | True if a radar chart has category axis labels. Applies only to radar charts. |
GetHasSeriesLines() | True if a stacked column chart or bar chart has series lines or if a Pie of Pie chart or Bar of Pie chart has connector lines between the two sections. Applies only to stacked column charts, bar charts, Pie of Pie charts, or Bar of Pie charts. |
GetHasUpDownBars() | True if a line chart has up and down bars. Applies only to line charts. |
GetHiLoLines() | Returns a HiLoLines object that represents the high-low lines for a series on a line chart. Applies only to line charts. |
GetLayoutProperties() | Represents the properties of layout. |
GetLeaderLines() | Represents leader lines on a chart. Leader lines connect data labels to data points. This object isn’t a collection; there’s no object that represents a single leader line. |
GetLegendEntry() | Gets the legend entry according to this series. |
GetMarker() | Gets the marker. |
GetName() | Gets or sets the name of the data series. |
GetOverlap() | Specifies how bars and columns are positioned. Can be a value between – 100 and 100. Applies only to 2-D bar and 2-D column charts. |
GetPlotOnSecondAxis() | Indicates if this series is plotted on second value axis. |
GetPoints() | Gets the collection of points in a series in a chart. |
GetSecondPlotSize() | Returns or sets the size of the secondary section of either a pie of pie chart or a bar of pie chart, as a percentage of the size of the primary pie. Can be a value from 5 to 200. |
GetSeriesLines() | Returns a SeriesLines object that represents the series lines for a stacked bar chart or a stacked column chart. Applies only to stacked bar and stacked column charts. |
GetShadow() | True if the series has a shadow. |
GetShapeProperties() | Gets the ShapePropertyCollection object that holds the visual shape properties of the Series. |
GetShowNegativeBubbles() | True if negative bubbles are shown for the chart group. Valid only for bubble charts. |
GetSizeRepresents() | Gets or sets what the bubble size represents on a bubble chart. |
GetSmooth() | Represents curve smoothing. True if curve smoothing is turned on for the line chart or scatter chart. Applies only to line and scatter connected by lines charts. |
GetSplitType() | Returns or sets a value that how to determine which data points are in the second pie or bar on a pie of pie or bar of pie chart. |
GetSplitValue() | Returns or sets a value that shall be used to determine which data points are in the second pie or bar on a pie of pie or bar of pie chart. |
GetTrendLines() | Returns all the trendlines of this series. |
GetType() | Gets or sets a data series’ type. |
GetUpBars() | Returns an DropBars object that represents the up bars on a line chart. Applies only to line charts. |
GetValues() | Represents the Y values of this chart series. |
GetValuesFormatCode() | Represents format code of Values’s NumberList. |
GetXErrorBar() | Represents X direction error bar of the series. |
GetXValues() | Represents the x values of the chart series. |
GetXValuesFormatCode() | Represents format code of X Values’s NumberList. |
GetYErrorBar() | Represents Y direction error bar of the series. |
IsAutoSplit() | Indicates whether the threshold value is automatic. |
IsColorVaried() | Represents if the color of points is varied. The chart must contain only one series. |
IsFiltered() | Indicates whether the series is selected or filtered.True represents this series is filtered, and it will not be displayed on the chart. |
IsNull() const | Checks whether the implementation object is nullptr. |
IsVerticalValues() | Indicates whether the data source is vertical. |
Move(int32_t count) | Moves the series up or down. |
explicit operator bool() const | operator bool() |
operator=(const Series& src) | operator= |
Series(Series_Impl* impl) | Constructs from an implementation object. |
Series(const Series& src) | Copy constructor. |
SetBar3DShapeType(Bar3DShapeType value) | Gets or sets the 3D shape type used with the 3-D bar or column chart. |
SetBubbleScale(int32_t value) | Gets or sets the scale factor for bubbles in the specified chart group. It can be an integer value from 0 (zero) to 300, corresponding to a percentage of the default size. Applies only to bubble charts. |
SetBubbleSizes(const U16String& value) | Gets or sets the bubble sizes values of the chart series. |
SetBubbleSizes(const char16_t* value) | Gets or sets the bubble sizes values of the chart series. |
SetDoughnutHoleSize(int32_t value) | Returns or sets the size of the hole in a doughnut chart group. The hole size is expressed as a percentage of the chart size, between 10 and 90 percent. |
SetExplosion(int32_t value) | The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter. |
SetFirstSliceAngle(int16_t value) | Gets or sets the angle of the first pie-chart or doughnut-chart slice, in degrees (clockwise from vertical). Applies only to pie, 3-D pie, and doughnut charts, 0 to 360. |
SetGapWidth(int16_t value) | Returns or sets the space between bar or column clusters, as a percentage of the bar or column width. The value of this property must be between 0 and 500. |
SetHas3DEffect(bool value) | True if the series has a three-dimensional appearance. Applies only to bubble charts. |
SetHasDropLines(bool value) | True if the chart has drop lines. Applies only to line chart or area charts. |
SetHasHiLoLines(bool value) | True if the line chart has high-low lines. Applies only to line charts. |
SetHasLeaderLines(bool value) | True if the series has leader lines. |
SetHasRadarAxisLabels(bool value) | True if a radar chart has category axis labels. Applies only to radar charts. |
SetHasSeriesLines(bool value) | True if a stacked column chart or bar chart has series lines or if a Pie of Pie chart or Bar of Pie chart has connector lines between the two sections. Applies only to stacked column charts, bar charts, Pie of Pie charts, or Bar of Pie charts. |
SetHasUpDownBars(bool value) | True if a line chart has up and down bars. Applies only to line charts. |
SetIsColorVaried(bool value) | Represents if the color of points is varied. The chart must contain only one series. |
SetIsFiltered(bool value) | Indicates whether the series is selected or filtered.True represents this series is filtered, and it will not be displayed on the chart. |
SetName(const U16String& value) | Gets or sets the name of the data series. |
SetName(const char16_t* value) | Gets or sets the name of the data series. |
SetOverlap(int16_t value) | Specifies how bars and columns are positioned. Can be a value between – 100 and 100. Applies only to 2-D bar and 2-D column charts. |
SetPlotOnSecondAxis(bool value) | Indicates if this series is plotted on second value axis. |
SetSecondPlotSize(int16_t value) | Returns or sets the size of the secondary section of either a pie of pie chart or a bar of pie chart, as a percentage of the size of the primary pie. Can be a value from 5 to 200. |
SetShadow(bool value) | True if the series has a shadow. |
SetShowNegativeBubbles(bool value) | True if negative bubbles are shown for the chart group. Valid only for bubble charts. |
SetSizeRepresents(BubbleSizeRepresents value) | Gets or sets what the bubble size represents on a bubble chart. |
SetSmooth(bool value) | Represents curve smoothing. True if curve smoothing is turned on for the line chart or scatter chart. Applies only to line and scatter connected by lines charts. |
SetSplitType(ChartSplitType value) | Returns or sets a value that how to determine which data points are in the second pie or bar on a pie of pie or bar of pie chart. |
SetSplitValue(double value) | Returns or sets a value that shall be used to determine which data points are in the second pie or bar on a pie of pie or bar of pie chart. |
SetType(ChartType value) | Gets or sets a data series’ type. |
SetValues(const U16String& value) | Represents the Y values of this chart series. |
SetValues(const char16_t* value) | Represents the Y values of this chart series. |
SetValuesFormatCode(const U16String& value) | Represents format code of Values’s NumberList. |
SetValuesFormatCode(const char16_t* value) | Represents format code of Values’s NumberList. |
SetXValues(const U16String& value) | Represents the x values of the chart series. |
SetXValues(const char16_t* value) | Represents the x values of the chart series. |
SetXValuesFormatCode(const U16String& value) | Represents format code of X Values’s NumberList. |
SetXValuesFormatCode(const char16_t* value) | Represents format code of X Values’s NumberList. |
~Series() | Destructor. |
Fields
Field | Description |
---|---|
_impl | The implementation object. |
Examples
Aspose::Cells::Startup();
//Instantiating a Workbook object
Workbook workbook;
//Adding a new worksheet to the Excel object
int sheetIndex = workbook.GetWorksheets().Add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.GetWorksheets().Get(sheetIndex);
//Adding a sample value to "A1" cell
worksheet.GetCells().Get(u"A1").PutValue(50);
//Adding a sample value to "A2" cell
worksheet.GetCells().Get(u"A2").PutValue(100);
//Adding a sample value to "A3" cell
worksheet.GetCells().Get(u"A3").PutValue(150);
//Adding a sample value to "A4" cell
worksheet.GetCells().Get(u"A4").PutValue(200);
//Adding a sample value to "B1" cell
worksheet.GetCells().Get(u"B1").PutValue(60);
//Adding a sample value to "B2" cell
worksheet.GetCells().Get(u"B2").PutValue(32);
//Adding a sample value to "B3" cell
worksheet.GetCells().Get(u"B3").PutValue(50);
//Adding a sample value to "B4" cell
worksheet.GetCells().Get(u"B4").PutValue(40);
//Adding a sample value to "C1" cell as category data
worksheet.GetCells().Get(u"C1").PutValue(u"Q1");
//Adding a sample value to "C2" cell as category data
worksheet.GetCells().Get(u"C2").PutValue(u"Q2");
//Adding a sample value to "C3" cell as category data
worksheet.GetCells().Get(u"C3").PutValue(u"Y1");
//Adding a sample value to "C4" cell as category data
worksheet.GetCells().Get(u"C4").PutValue(u"Y2");
//Adding a chart to the worksheet
int chartIndex = worksheet.GetCharts().Add(ChartType::Column, 5, 0, 15, 5);
//Accessing the instance of the newly added chart
Chart chart = worksheet.GetCharts().Get(chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
int seriesIndex = chart.GetNSeries().Add(u"A1:B4", true);
//Setting the data source for the category data of NSeries
chart.GetNSeries().SetCategoryData(u"C1:C4");
Series series = chart.GetNSeries().Get(seriesIndex);
//Setting the values of the series.
series.SetValues(u"=B1:B4");
//Changing the chart type of the series.
series.SetType(ChartType::Line);
//Setting marker properties.
series.GetMarker().SetMarkerStyle(ChartMarkerType::Circle);
series.GetMarker().SetForegroundColorSetType(FormattingType::Automatic);
series.GetMarker().SetForegroundColor(Color{ 0xff, 0, 0, 0 });
series.GetMarker().SetBackgroundColorSetType(FormattingType::Automatic);
//Saving the Excel file
workbook.Save(u"book1.xls");
Aspose::Cells::Cleanup();
See Also
- Namespace Aspose::Cells::Charts
- Library Aspose.Cells for C++