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 "B1" cell
$worksheet->getCells()->get("B1")->putValue(4);
//Adding a sample value to "B2" cell
$worksheet->getCells()->get("B2")->putValue(20);
//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::COLUMN, 5, 0, 25, 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 "B3"
$chart->getNSeries()->add("A1:B3", true);
//Set the max value of value axis
$chart->getValueAxis()->setMaxValue(200);
//Set the min value of value axis
$chart->getValueAxis()->setMinValue(0);
//Set the major unit
$chart->getValueAxis()->setMajorUnit(25);
//Category(X) axis crosses at the maxinum value
$chart->getValueAxis()->setCrossType(cells\CrossType::MAXIMUM);
//Set he number of categories or series between tick-mark labels->
$chart->getCategoryAxis()->setTickLabelSpacing(2);
| Property Getters/Setters Summary | ||
|---|---|---|
function | getArea() | |
Gets the |
||
function | getAxisBetweenCategories() | |
function | setAxisBetweenCategories(value) | |
| Represents if the value axis crosses the category axis between categories. | ||
function | getAxisLabels() | |
Gets the labels of the axis after call Chart.Calculate() method.
|
||
function | getAxisLine() | |
Gets the appearance of an Axis.
|
||
function | getBaseUnitScale() | |
function | setBaseUnitScale(value) | |
| Represents the base unit scale for the category axis. The value of the property is TimeUnit integer constant. | ||
function | getBins() | |
Represents bins on a chart(Histogram/Pareto) axis
|
||
function | getCategoryType() | |
function | setCategoryType(value) | |
| Represents the category axis type. The value of the property is CategoryType integer constant. | ||
function | getCrossAt() | |
function | setCrossAt(value) | |
| Represents the point on the value axis where the category axis crosses it. | ||
function | getCrossType() | |
function | setCrossType(value) | |
|
Represents the |
||
function | getCustUnit() | |
function | setCustUnit(value) | |
| Specifies a custom value for the display unit. | ||
function | getDisplayUnit() | |
function | setDisplayUnit(value) | |
| Represents the unit label for the specified axis. The value of the property is DisplayUnitType integer constant. | ||
function | getDisplayUnitLabel() | |
Represents a unit label on an axis in the specified chart.
Unit labels are useful for charting large values— for example, in the millions or billions.
|
||
function | hasMultiLevelLabels() | |
function | setHasMultiLevelLabels(value) | |
| Indicates whether the labels shall be shown as multi level. | ||
function | isAutomaticMajorUnit() | |
function | setAutomaticMajorUnit(value) | |
| Indicates whether the major unit of the axis is automatically assigned. | ||
function | isAutomaticMaxValue() | |
function | setAutomaticMaxValue(value) | |
| Indicates whether the max value is automatically assigned. | ||
function | isAutomaticMinorUnit() | |
function | setAutomaticMinorUnit(value) | |
| Indicates whether the minor unit of the axis is automatically assigned. | ||
function | isAutomaticMinValue() | |
function | setAutomaticMinValue(value) | |
| Indicates whether the min value is automatically assigned. | ||
function | isAutoTickLabelSpacing() | |
function | setAutoTickLabelSpacing(value) | |
| Indicates whether the spacing of tick label is automatic | ||
function | isBaseUnitAuto() | |
function | setBaseUnitAuto(value) | |
| Represents whether the base unit is automatic. | ||
function | isDisplayUnitLabelShown() | |
function | setDisplayUnitLabelShown(value) | |
| Represents if the display unit label is shown on the specified axis. | ||
function | isLogarithmic() | |
function | setLogarithmic(value) | |
| Represents if the value axis scale type is logarithmic or not. | ||
function | isPlotOrderReversed() | |
function | setPlotOrderReversed(value) | |
| Represents if Microsoft Excel plots data points from last to first. | ||
function | isVisible() | |
function | setVisible(value) | |
| Represents if the axis is visible. | ||
function | getLogBase() | |
function | setLogBase(value) | |
| Represents the logarithmic base. Default value is 10.Only applies for Excel2007. | ||
function | getMajorGridLines() | |
Represents major gridlines on a chart axis.
|
||
function | getMajorTickMark() | |
function | setMajorTickMark(value) | |
| Represents the type of major tick mark for the specified axis. The value of the property is TickMarkType integer constant. | ||
function | getMajorUnit() | |
function | setMajorUnit(value) | |
| Represents the major units for the axis. | ||
function | getMajorUnitScale() | |
function | setMajorUnitScale(value) | |
| Represents the major unit scale for the category axis. The value of the property is TimeUnit integer constant. | ||
function | getMaxValue() | |
function | setMaxValue(value) | |
| Represents the maximum value on the value axis. | ||
function | getMinorGridLines() | |
Represents minor gridlines on a chart axis.
|
||
function | getMinorTickMark() | |
function | setMinorTickMark(value) | |
| Represents the type of minor tick mark for the specified axis. The value of the property is TickMarkType integer constant. | ||
function | getMinorUnit() | |
function | setMinorUnit(value) | |
| Represents the minor units for the axis. | ||
function | getMinorUnitScale() | |
function | setMinorUnitScale(value) | |
| Represents the major unit scale for the category axis. The value of the property is TimeUnit integer constant. | ||
function | getMinValue() | |
function | setMinValue(value) | |
| Represents the minimum value on the value axis. | ||
function | getTickLabelPosition() | |
function | setTickLabelPosition(value) | |
| Represents the position of tick-mark labels on the specified axis. The value of the property is TickLabelPositionType integer constant. | ||
function | getTickLabels() | |
Returns a |
||
function | getTickLabelSpacing() | |
function | setTickLabelSpacing(value) | |
| Represents the number of categories or series between tick-mark labels. Applies only to category and series axes. | ||
function | getTickMarkSpacing() | |
function | setTickMarkSpacing(value) | |
| Returns or sets the number of categories or series between tick marks. Applies only to category and series axes. | ||
function | getTitle() | |
Gets the axis' title.
|
||
| Method Summary | ||
|---|---|---|
function | isAutoCross() | |
Indicates whether Microsoft Workbook automatically sets the axis crossing point.
|
||
function | isCrossAtMax() | |
Indicates whether Microsoft Workbook automatically sets the axis crossing point.
|
||
function | setAutoCross() | |
Sets the axis crossing point as automatic.
|
||
function | setCrossAtMax(isCrossAtMax) | |
Sets whether the axis crosses at the maximum value.
|
||
function getArea()
function isAutomaticMinValue() / function setAutomaticMinValue(value)
function getMinValue() / function setMinValue(value)
function isAutomaticMaxValue() / function setAutomaticMaxValue(value)
function getMaxValue() / function setMaxValue(value)
function isAutomaticMajorUnit() / function setAutomaticMajorUnit(value)
function getMajorUnit() / function setMajorUnit(value)
function isAutomaticMinorUnit() / function setAutomaticMinorUnit(value)
function getMinorUnit() / function setMinorUnit(value)
function getAxisLine()
function getMajorTickMark() / function setMajorTickMark(value)
function getMinorTickMark() / function setMinorTickMark(value)
function getTickLabelPosition() / function setTickLabelPosition(value)
function getCrossAt() / function setCrossAt(value)
function getCrossType() / function setCrossType(value)
function getLogBase() / function setLogBase(value)
function isLogarithmic() / function setLogarithmic(value)
function isPlotOrderReversed() / function setPlotOrderReversed(value)
function getAxisBetweenCategories() / function setAxisBetweenCategories(value)
function getTickLabels()
function getTickLabelSpacing() / function setTickLabelSpacing(value)
function isAutoTickLabelSpacing() / function setAutoTickLabelSpacing(value)
function getTickMarkSpacing() / function setTickMarkSpacing(value)
function getDisplayUnit() / function setDisplayUnit(value)
function getCustUnit() / function setCustUnit(value)
function getDisplayUnitLabel()
function isDisplayUnitLabelShown() / function setDisplayUnitLabelShown(value)
function getTitle()
function getCategoryType() / function setCategoryType(value)
function getBaseUnitScale() / function setBaseUnitScale(value)
function isBaseUnitAuto() / function setBaseUnitAuto(value)
function getMajorUnitScale() / function setMajorUnitScale(value)
Example:
$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 "B1" cell
$worksheet->getCells()->get("B1")->putValue(4);
//Adding a sample value to "B2" cell
$worksheet->getCells()->get("B2")->putValue(20);
//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::COLUMN, 5, 0, 25, 5);
//Accessing the instance of the newly added chart
$chart = $worksheet->getCharts()->get($chartIndex);
$chart->getNSeries()->add("A1:B3", true);
$chart->getCategoryAxis()->setCategoryType(cells\CategoryType::TIME_SCALE);
$chart->getCategoryAxis()->setMajorUnitScale(cells\TimeUnit::MONTHS);
$chart->getCategoryAxis()->setMajorUnit(2);function getMinorUnitScale() / function setMinorUnitScale(value)
Example:
$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 "B1" cell
$worksheet->getCells()->get("B1")->putValue(4);
//Adding a sample value to "B2" cell
$worksheet->getCells()->get("B2")->putValue(20);
//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::COLUMN, 5, 0, 25, 5);
//Accessing the instance of the newly added chart
$chart = $worksheet->getCharts()->get($chartIndex);
$chart->getNSeries()->add("A1:B3", true);
$chart->getCategoryAxis()->setCategoryType(cells\CategoryType::TIME_SCALE);
$chart->getCategoryAxis()->setMinorUnitScale(cells\TimeUnit::MONTHS);
$chart->getCategoryAxis()->setMinorUnit(2);function isVisible() / function setVisible(value)
function getMajorGridLines()
Example:
$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 "B1" cell
$worksheet->getCells()->get("B1")->putValue(4);
//Adding a sample value to "B2" cell
$worksheet->getCells()->get("B2")->putValue(20);
//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::COLUMN, 5, 0, 25, 5);
//Accessing the instance of the newly added chart
$chart = $worksheet->getCharts()->get($chartIndex);
$chart->getNSeries()->add("A1:B3", true);
$chart->getValueAxis()->getMajorGridLines()->setVisible(false);
$chart->getCategoryAxis()->getMajorGridLines()->setVisible(true);function getMinorGridLines()
function hasMultiLevelLabels() / function setHasMultiLevelLabels(value)
function getAxisLabels()
function getBins()
function isAutoCross()
function isCrossAtMax()
function setAutoCross()
function setCrossAtMax(isCrossAtMax)