Example:
$workbook = new cells\Workbook();
$cells = $workbook->getWorksheets()->get(0)->getCells();
//Put values in cells
$cells->get("A1")->putValue(1);
$cells->get("A2")->putValue(2);
$cells->get("A3")->putValue(3);
$chartIndex = $workbook->getWorksheets()->get(0)->getCharts()->add(cells\ChartType::COLUMN, 3, 3, 15, 10);
$chart = $workbook->getWorksheets()->get(0)->getCharts()->get($chartIndex);
$chart->getNSeries()->add("A1:a3", true);
$chart->getNSeries()->get(0)->getTrendLines()->add(cells\TrendlineType::LINEAR, "MyTrendLine");
$line = $chart->getNSeries()->get(0)->getTrendLines()->get(0);
$line->setDisplayEquation(true);
$line->setDisplayRSquared(true);
$line->setColor(cells\Color::getRed());
| Property Getters/Setters Summary | ||
|---|---|---|
function | getCount() | |
function | get(index) | |
| Gets a object by its index. | ||
| Method Summary | ||
|---|---|---|
function | add(type) | |
| Adds a object to this collection with specified type. | ||
function | add(type, name) | |
| Adds a object to this collection with specified type and name. | ||
function | add(value) | → inherited from CollectionBase |
| Reserved for internal use. | ||
function | clear() | → inherited from CollectionBase |
function | contains(value) | → inherited from CollectionBase |
| Reserved for internal use. | ||
function | get(index) | → inherited from CollectionBase |
| Reserved for internal use. | ||
function | indexOf(value) | → inherited from CollectionBase |
| Reserved for internal use. | ||
function | iterator() | → inherited from CollectionBase |
function | removeAt(index) | → inherited from CollectionBase |
| Property Getters/Setters Detail |
|---|
getCount : Number | |
function getCount() | |
get : Trendline | |
function get(index) | |
| Method Detail |
|---|
add | |
function add(type) | |
type: Number - A add | |
function add(type, name) | |
type: Number - A name: String - Trendline name.clear | |
function clear() | |
removeAt | |
function removeAt(index) | |
iterator | |
function iterator() | |
get | |
function get(index) | |
contains | |
function contains(value) | |
add | |
function add(value) | |
indexOf | |
function indexOf(value) | |