Example:
//Instantiating a Workbook object $workbook = new cells\Workbook(); //Adding a new worksheet to the Excel object $sheetIndex = $workbook->getWorksheets()->add(); //Obtaining the reference of the newly added worksheet by passing its sheet index $worksheet = $workbook->getWorksheets()->get($sheetIndex); //Adding a sample value to "A1" cell $worksheet->getCells()->get("A1")->putValue(50); //Adding a sample value to "A2" cell $worksheet->getCells()->get("A2")->putValue(100); //Adding a sample value to "A3" cell $worksheet->getCells()->get("A3")->putValue(150); //Adding a sample value to "A4" cell $worksheet->getCells()->get("A4")->putValue(200); //Adding a sample value to "B1" cell $worksheet->getCells()->get("B1")->putValue(60); //Adding a sample value to "B2" cell $worksheet->getCells()->get("B2")->putValue(32); //Adding a sample value to "B3" cell $worksheet->getCells()->get("B3")->putValue(50); //Adding a sample value to "B4" cell $worksheet->getCells()->get("B4")->putValue(40); //Adding a sample value to "C1" cell as category data $worksheet->getCells()->get("C1")->putValue("Q1"); //Adding a sample value to "C2" cell as category data $worksheet->getCells()->get("C2")->putValue("Q2"); //Adding a sample value to "C3" cell as category data $worksheet->getCells()->get("C3")->putValue("Y1"); //Adding a sample value to "C4" cell as category data $worksheet->getCells()->get("C4")->putValue("Y2"); //Adding a chart to the worksheet $chartIndex = $worksheet->getCharts()->add(cells\ChartType::COLUMN, 5, 0, 15, 5); //Accessing the instance of the newly added chart $chart = $worksheet->getCharts()->get($chartIndex); //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4" $chart->getNSeries()->add("A1:B4", true); //Setting the data source for the category data of NSeries $chart->getNSeries()->setCategoryData("C1:C4"); $series = $chart->getNSeries()->get(1); //Setting the values of the series $series->setValues("=B1:B4"); //Changing the chart type of the series $series->setType(cells\ChartType::LINE); //Setting marker properties $series->getMarker()->setMarkerStyle(cells\ChartMarkerType::CIRCLE); $series->getMarker()->setForegroundColorSetType(cells\FormattingType::AUTOMATIC); $series->getMarker()->setForegroundColor(cells\Color::getBlack()); $series->getMarker()->setBackgroundColorSetType(cells\FormattingType::AUTOMATIC);
Property Getters/Setters Summary | ||
---|---|---|
function | getArea() | |
Represents the background area of Series object.
|
||
function | getBar3DShapeType() | |
function | setBar3DShapeType(value) | |
Gets or sets the 3D shape type used with the 3-D bar or column chart. The value of the property is Bar3DShapeType integer constant. | ||
function | getBorder() | |
Represents border of Series object.
|
||
function | getBubbleScale() | |
function | setBubbleScale(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. | ||
function | getBubbleSizeRepresents() | |
function | setBubbleSizeRepresents(value) | |
Gets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant. | ||
function | getBubbleSizes() | |
function | setBubbleSizes(value) | |
Gets or sets the bubble sizes values of the chart series. | ||
function | getCountOfDataValues() | |
Gets the number of the data values.
|
||
function | getDataLabels() | |
Represents the DataLabels object for the specified ASeries.
|
||
function | getDisplayName() | |
Gets the series's name that displays on the chart graph.
|
||
function | getDoughnutHoleSize() | |
function | setDoughnutHoleSize(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. | ||
function | getDownBars() | |
Returns a |
||
function | getDropLines() | |
Returns a |
||
function | getExplosion() | |
function | setExplosion(value) | |
The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter. | ||
function | getFirstSliceAngle() | |
function | setFirstSliceAngle(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. | ||
function | getGapWidth() | |
function | setGapWidth(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. | ||
function | getHas3DEffect() | |
function | setHas3DEffect(value) | |
True if the series has a three-dimensional appearance. Applies only to bubble charts. | ||
function | hasDropLines() | |
function | setHasDropLines(value) | |
True if the chart has drop lines. Applies only to line chart or area charts. | ||
function | hasHiLoLines() | |
function | setHasHiLoLines(value) | |
True if the line chart has high-low lines. Applies only to line charts. | ||
function | hasLeaderLines() | |
function | setHasLeaderLines(value) | |
True if the series has leader lines. | ||
function | hasRadarAxisLabels() | |
function | setHasRadarAxisLabels(value) | |
True if a radar chart has category axis labels. Applies only to radar charts. | ||
function | hasSeriesLines() | |
function | setHasSeriesLines(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. | ||
function | hasUpDownBars() | |
function | setHasUpDownBars(value) | |
True if a line chart has up and down bars. Applies only to line charts. | ||
function | getHiLoLines() | |
Returns a HiLoLines object that represents the high-low lines for a series on a line chart.
Applies only to line charts.
|
||
function | isAutoSplit() | |
Indicates whether the threshold value is automatic.
|
||
function | isColorVaried() | |
function | setColorVaried(value) | |
Represents if the color of points is varied. The chart must contain only one series. | ||
function | isFiltered() | |
function | setFiltered(value) | |
Indicates whether the series is selected or filtered.True represents this series is filtered, and it will not be displayed on the chart. | ||
function | isVerticalValues() | |
Indicates whether the data source is vertical.
|
||
function | getLayoutProperties() | |
Represents the properties of layout.
|
||
function | 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.
|
||
function | getLegendEntry() | |
Gets the legend entry according to this series.
|
||
function | getMarker() | |
Gets the |
||
function | getName() | |
function | setName(value) | |
Gets or sets the name of the data series. | ||
function | getOverlap() | |
function | setOverlap(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. | ||
function | getPlotOnSecondAxis() | |
function | setPlotOnSecondAxis(value) | |
Indicates if this series is plotted on second value axis. | ||
function | getPoints() | |
Gets the collection of points in a series in a chart.
|
||
function | getSecondPlotSize() | |
function | setSecondPlotSize(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. | ||
function | 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.
|
||
function | getShadow() | |
function | setShadow(value) | |
True if the series has a shadow. | ||
function | getShapeProperties() | |
Gets the |
||
function | getShowNegativeBubbles() | |
function | setShowNegativeBubbles(value) | |
True if negative bubbles are shown for the chart group. Valid only for bubble charts. | ||
function | getSizeRepresents() | |
function | setSizeRepresents(value) | |
Gets or sets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant. | ||
function | getSmooth() | |
function | setSmooth(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. | ||
function | getSplitType() | |
function | setSplitType(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. The value of the property is ChartSplitType integer constant. | ||
function | getSplitValue() | |
function | setSplitValue(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. | ||
function | getTrendLines() | |
Returns all the trendlines of this series.
|
||
function | getType() | |
function | setType(value) | |
Gets or sets a data series' type. The value of the property is ChartType integer constant. | ||
function | getUpBars() | |
Returns an DropBars object that represents the up bars on a line chart.
Applies only to line charts.
|
||
function | getValues() | |
function | setValues(value) | |
Represents the Y values of this chart series. | ||
function | getValuesFormatCode() | |
function | setValuesFormatCode(value) | |
Represents format code of Values's NumberList. | ||
function | getXErrorBar() | |
Represents X direction error bar of the series.
|
||
function | getXValues() | |
function | setXValues(value) | |
Represents the x values of the chart series. | ||
function | getYErrorBar() | |
Represents Y direction error bar of the series.
|
Method Summary | ||
---|---|---|
function | move(count) | |
Moves the series up or down.
|
function isFiltered() / function setFiltered(value)
function getLayoutProperties()
function getPoints()
function getArea()
function getBorder()
function getName() / function setName(value)
Example:
//Reference name to a cell $workbook = new cells\Workbook(); //Get the first worksheet $worksheet = $workbook->getWorksheets()->get(0); $cells = $worksheet->getCells(); //Put values in cells $cells->get("A1")->putValue(1); $cells->get("A2")->putValue(2); $cells->get("A3")->putValue(3); //Adding a chart to the worksheet $chartIndex = $worksheet->getCharts()->add(cells\ChartType::COLUMN, 5, 0, 15, 5); //Accessing the instance of the newly added chart $chart = $worksheet->getCharts()->get($chartIndex); //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4" $chart->getNSeries()->add("A1:B4", true); //Reference name to a cell $chart->getNSeries()->get(0)->setName("=A1"); //Set a string to name $chart->getNSeries()->get(0)->setName("First Series");
function getDisplayName()
function getCountOfDataValues()
function isVerticalValues()
function getValues() / function setValues(value)
function getValuesFormatCode() / function setValuesFormatCode(value)
function getXValues() / function setXValues(value)
function getBubbleSizes() / function setBubbleSizes(value)
function getTrendLines()
function getSmooth() / function setSmooth(value)
function getShadow() / function setShadow(value)
function getHas3DEffect() / function setHas3DEffect(value)
function getBar3DShapeType() / function setBar3DShapeType(value)
function getDataLabels()
function getType() / function setType(value)
function getMarker()
function getPlotOnSecondAxis() / function setPlotOnSecondAxis(value)
function getXErrorBar()
function getYErrorBar()
function hasHiLoLines() / function setHasHiLoLines(value)
function getHiLoLines()
function hasSeriesLines() / function setHasSeriesLines(value)
function getSeriesLines()
function hasDropLines() / function setHasDropLines(value)
function getDropLines()
function hasUpDownBars() / function setHasUpDownBars(value)
function getUpBars()
function getDownBars()
function isColorVaried() / function setColorVaried(value)
function getGapWidth() / function setGapWidth(value)
function getFirstSliceAngle() / function setFirstSliceAngle(value)
function getOverlap() / function setOverlap(value)
function getSecondPlotSize() / function setSecondPlotSize(value)
function getSplitType() / function setSplitType(value)
function getSplitValue() / function setSplitValue(value)
function isAutoSplit()
function getBubbleScale() / function setBubbleScale(value)
function getSizeRepresents() / function setSizeRepresents(value)
function getShowNegativeBubbles() / function setShowNegativeBubbles(value)
function getDoughnutHoleSize() / function setDoughnutHoleSize(value)
function getExplosion() / function setExplosion(value)
function hasRadarAxisLabels() / function setHasRadarAxisLabels(value)
function hasLeaderLines() / function setHasLeaderLines(value)
function getLeaderLines()
function getLegendEntry()
function getShapeProperties()
function getBubbleSizeRepresents() / function setBubbleSizeRepresents(value)