Example:
//Instantiating a Workbook object
$workbook = new cells\Workbook();
//Obtaining the reference of the first worksheet
$worksheet = $workbook->getWorksheets()->get(0);
//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 "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 chart to the worksheet
$chartIndex = $worksheet->getCharts()->add(cells\ChartType::PIE_EXPLODED, 5, 0, 25, 10);
//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 "B3"
$chart->getNSeries()->add("A1:B3", true);
//Show Data Labels
$chart->getNSeries()->get(0)->getDataLabels()->setShowValue(true);
$count = java_values($chart->getNSeries()->get(0)->getPoints()->getCount());
for ($i = 0; $i < $count; $i++)
{
//Get Data Point
$point = $chart->getNSeries()->get(0)->getPoints()->get($i);
//Set Pir Explosion
$point->setExplosion(15);
//Set Border Color
$point->getBorder()->setColor(cells\Color::getRed());
}
| Property Getters/Setters Summary | ||
|---|---|---|
function | getArcEndPointXPx() | |
| Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart. | ||
function | getArcEndPointYPx() | |
| Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart. | ||
function | getArcStartPointXPx() | |
| Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart. | ||
function | getArcStartPointYPx() | |
| Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart. | ||
function | getArea() | |
|
Gets the |
||
function | getBorder() | |
|
Gets the |
||
function | getBorderWidthPx() | |
| Gets the width of border in units of pixels after calls Chart.Calculate() method. | ||
function | getDataLabels() | |
| Returns a DataLabels object that represents the data label associated with the point. | ||
function | getEndAngle() | |
| Gets the ending angle for the pie section, measured in degrees clockwise from the x-axis after calls Chart.Calculate() method. Applies to Pie chart. | ||
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 | getInnerArcEndPointXPx() | |
| Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. | ||
function | getInnerArcEndPointYPx() | |
| Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. | ||
function | getInnerArcStartPointXPx() | |
| Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. | ||
function | getInnerArcStartPointYPx() | |
| Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. | ||
function | getInnerRadiusPx() | |
| Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method. Applies to Doughnut chart. | ||
function | isInSecondaryPlot() | |
function | setInSecondaryPlot(value) | |
| Gets or sets a value indicates whether this data points is in the second pie or bar on a pie of pie or bar of pie chart | ||
function | getMarker() | |
|
Gets the |
||
function | getMarkerBackgroundColor() | |
function | setMarkerBackgroundColor(value) | |
| Represents the marker backgournd color in a line chart, scatter chart, or radar chart. | ||
function | getMarkerBackgroundColorSetType() | |
function | setMarkerBackgroundColorSetType(value) | |
| Gets or sets the marker background color set type. The value of the property is FormattingType integer constant. | ||
function | getMarkerForegroundColor() | |
function | setMarkerForegroundColor(value) | |
| Represents the marker foregournd color in a line chart, scatter chart, or radar chart. | ||
function | getMarkerForegroundColorSetType() | |
function | setMarkerForegroundColorSetType(value) | |
| Gets or sets the marker foreground color set type. The value of the property is FormattingType integer constant. | ||
function | getMarkerSize() | |
function | setMarkerSize(value) | |
| Represents the marker size in a line chart, scatter chart, or radar chart. | ||
function | getMarkerStyle() | |
function | setMarkerStyle(value) | |
| Represents the marker style in a line chart, scatter chart, or radar chart. The value of the property is ChartMarkerType integer constant. | ||
function | getRadiusPx() | |
| Gets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method. | ||
function | getShadow() | |
function | setShadow(value) | |
| True if the chartpoint has a shadow. | ||
function | getShapeHeight() | |
| Gets the height in units of 1/4000 of chart's height after calls Chart.Calculate() method. | ||
function | getShapeHeightPx() | |
| Gets the height in units of pixels after calls Chart.Calculate() method. | ||
function | getShapeProperties() | |
| Gets the object that holds the visual shape properties of the ChartPoint. | ||
function | getShapeWidth() | |
| Gets the width in units of 1/4000 of chart's width after calls Chart.Calculate() method. | ||
function | getShapeWidthPx() | |
| Gets the width in units of pixels after calls Chart.Calculate() method. | ||
function | getShapeX() | |
| Gets the x coordinate of the upper left corner in units of 1/4000 of chart's width after calls Chart.Calculate() method. | ||
function | getShapeXPx() | |
| Gets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method. | ||
function | getShapeY() | |
| Gets the y coordinate of the upper left corner in units of 1/4000 of chart's height after calls Chart.Calculate() method. | ||
function | getShapeYPx() | |
| Gets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method. | ||
function | getStartAngle() | |
| Gets the starting angle for the pie section, measured in degrees clockwise from the x-axis after calls Chart.Calculate() method. Applies to Pie chart. | ||
function | getXValue() | |
function | setXValue(value) | |
| Gets or sets the X value of the chart point. | ||
function | getXValueType() | |
| Gets X value type of the chart point. The value of the property is CellValueType integer constant. | ||
function | getYValue() | |
function | setYValue(value) | |
| Gets or sets the Y value of the chart point. | ||
function | getYValueType() | |
| Gets Y value type of the chart point. The value of the property is CellValueType integer constant. | ||
| Method Summary | ||
|---|---|---|
function | getBottomPointCount() | |
| Gets the number of bottom points after calls Chart.Calculate() method. | ||
function | getBottomPointXPx(index) | |
| Gets x-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid | ||
function | getBottomPointYPx(index) | |
| Gets y-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid | ||
function | getOnCategoryAxisPointCount() | |
| Gets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart. | ||
function | getOnCategoryAxisPointXPx(index) | |
| Gets x-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Aarea chart. | ||
function | getOnCategoryAxisPointYPx(index) | |
| Gets y-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart. | ||
function | getTopPointCount() | |
| Gets the number of top points after calls Chart.Calculate() method. | ||
function | getTopPointXPx(index) | |
| Gets x-coordinate of the top point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D | ||
function | getTopPointYPx(index) | |
| Gets y-coordinate of the top point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D | ||
| Property Getters/Setters Detail |
|---|
getExplosion/setExplosion : Number | |
function getExplosion() / function setExplosion(value) | |
getShadow/setShadow : boolean | |
function getShadow() / function setShadow(value) | |
getBorder : Line | |
function getBorder() | |
getArea : Area | |
function getArea() | |
getMarker : Marker | |
function getMarker() | |
getMarkerStyle/setMarkerStyle : Number | |
function getMarkerStyle() / function setMarkerStyle(value) | |
getMarkerSize/setMarkerSize : Number | |
function getMarkerSize() / function setMarkerSize(value) | |
getMarkerForegroundColor/setMarkerForegroundColor : Color | |
function getMarkerForegroundColor() / function setMarkerForegroundColor(value) | |
getMarkerForegroundColorSetType/setMarkerForegroundColorSetType : Number | |
function getMarkerForegroundColorSetType() / function setMarkerForegroundColorSetType(value) | |
getMarkerBackgroundColor/setMarkerBackgroundColor : Color | |
function getMarkerBackgroundColor() / function setMarkerBackgroundColor(value) | |
getMarkerBackgroundColorSetType/setMarkerBackgroundColorSetType : Number | |
function getMarkerBackgroundColorSetType() / function setMarkerBackgroundColorSetType(value) | |
getDataLabels : DataLabels | |
function getDataLabels() | |
getYValue/setYValue : Object | |
function getYValue() / function setYValue(value) | |
getYValueType : Number | |
function getYValueType() | |
getXValue/setXValue : Object | |
function getXValue() / function setXValue(value) | |
getXValueType : Number | |
function getXValueType() | |
getShapeProperties : ShapePropertyCollection | |
function getShapeProperties() | |
isInSecondaryPlot/setInSecondaryPlot : boolean | |
function isInSecondaryPlot() / function setInSecondaryPlot(value) | |
getShapeX : Number | |
function getShapeX() | |
getShapeY : Number | |
function getShapeY() | |
getShapeWidth : Number | |
function getShapeWidth() | |
getShapeHeight : Number | |
function getShapeHeight() | |
getShapeXPx : Number | |
function getShapeXPx() | |
getShapeYPx : Number | |
function getShapeYPx() | |
getShapeWidthPx : Number | |
function getShapeWidthPx() | |
getShapeHeightPx : Number | |
function getShapeHeightPx() | |
getBorderWidthPx : Number | |
function getBorderWidthPx() | |
getRadiusPx : Number | |
function getRadiusPx() | |
getInnerRadiusPx : Number | |
function getInnerRadiusPx() | |
getStartAngle : Number | |
function getStartAngle() | |
getEndAngle : Number | |
function getEndAngle() | |
getArcStartPointXPx : Number | |
function getArcStartPointXPx() | |
getArcStartPointYPx : Number | |
function getArcStartPointYPx() | |
getArcEndPointXPx : Number | |
function getArcEndPointXPx() | |
getArcEndPointYPx : Number | |
function getArcEndPointYPx() | |
getInnerArcStartPointXPx : Number | |
function getInnerArcStartPointXPx() | |
getInnerArcStartPointYPx : Number | |
function getInnerArcStartPointYPx() | |
getInnerArcEndPointXPx : Number | |
function getInnerArcEndPointXPx() | |
getInnerArcEndPointYPx : Number | |
function getInnerArcEndPointYPx() | |
| Method Detail |
|---|
getTopPointCount | |
function getTopPointCount() | |
getTopPointXPx | |
function getTopPointXPx(index) | |
getTopPointYPx | |
function getTopPointYPx(index) | |
getBottomPointCount | |
function getBottomPointCount() | |
getBottomPointXPx | |
function getBottomPointXPx(index) | |
getBottomPointYPx | |
function getBottomPointYPx(index) | |
getOnCategoryAxisPointCount | |
function getOnCategoryAxisPointCount() | |
getOnCategoryAxisPointXPx | |
function getOnCategoryAxisPointXPx(index) | |
getOnCategoryAxisPointYPx | |
function getOnCategoryAxisPointYPx(index) | |