Example:
$workbook = new cells\Workbook(); $charts = $workbook->getWorksheets()->get(0)->getCharts(); //Create a chart $chart = $charts->get($charts->add(cells\ChartType::COLUMN, 1, 1, 10, 10)); $cells = $workbook->getWorksheets()->get(0)->getCells(); for($i=0; $i<3; $i++) { $cells->get($i, 0)->putValue($i+1); $cells->get($i, 1)->putValue($i+5); } $chart->NSeries->Add("A1:B3", true); //Filling the area of the 2nd NSeries with a gradient $chart->getNSeries()->get(1)->getArea()->getFillFormat()->setOneColorGradient(cells\Color::getLime(), 1, cells\GradientStyleType::HORIZONTAL, 1);
Property Getters/Setters Summary | ||
---|---|---|
function | getFillType() | |
function | setFillType(value) | |
Gets and sets fill type The value of the property is FillType integer constant. | ||
function | getGradientColor1() | |
Returns the gradient color 1 for the specified fill. | ||
function | getGradientColor2() | |
Returns the gradient color 2 for the specified fill. | ||
function | getGradientColorType() | |
Returns the gradient color type for the specified fill. The value of the property is GradientColorType integer constant. | ||
function | getGradientDegree() | |
Returns the gradient degree for the specified fill. Only applies for Excel 2007. | ||
function | getGradientFill() | |
Gets |
||
function | getGradientStyle() | |
Returns the gradient style for the specified fill. The value of the property is GradientStyleType integer constant. | ||
function | getGradientVariant() | |
Returns the gradient variant for the specified fill. Only applies for Excel 2007. | ||
function | getImageData() | |
function | setImageData(value) | |
Gets and sets the picture image data. | ||
function | getPattern() | |
function | setPattern(value) | |
Represents an area's display pattern. The value of the property is FillPattern integer constant. | ||
function | getPatternFill() | |
Gets |
||
function | getPictureFormatType() | |
function | setPictureFormatType(value) | |
Gets and sets the picture format type. The value of the property is FillPictureType integer constant. | ||
function | getPresetColor() | |
Returns the gradient preset color for the specified fill. The value of the property is GradientPresetType integer constant. | ||
function | getScale() | |
function | setScale(value) | |
Gets and sets the picture format scale. | ||
function | getSetType() | |
function | setSetType(value) | |
Gets the fill format set type. The value of the property is FormatSetType integer constant. | ||
function | getSolidFill() | |
Gets |
||
function | getTexture() | |
function | setTexture(value) | |
Represents the texture type for the specified fill. The value of the property is TextureType integer constant. | ||
function | getTextureFill() | |
Gets |
||
function | getTransparency() | |
function | setTransparency(value) | |
Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear). | ||
function | getType() | |
function | setType(value) | |
Gets and sets the fill type. The value of the property is FillType integer constant. |
Method Summary | ||
---|---|---|
function | setOneColorGradient(color, degree, style, variant) | |
Sets the specified fill to a one-color gradient. Only applies for Excel 2007. | ||
function | setPresetColorGradient(presetColor, style, variant) | |
Sets the specified fill to a preset-color gradient. Only applies for Excel 2007. | ||
function | setTwoColorGradient(color1, color2, style, variant) | |
Sets the specified fill to a two-color gradient. Only applies for Excel 2007. | ||
function | setTwoColorGradient(color1, transparency1, color2, transparency2, style, variant) | |
Sets the specified fill to a two-color gradient. Only applies for Excel 2007. |
Property Getters/Setters Detail |
---|
getType/setType : Number | |
function getType() / function setType(value) |
getFillType/setFillType : Number | |
function getFillType() / function setFillType(value) |
getTransparency/setTransparency : Number | |
function getTransparency() / function setTransparency(value) |
getSetType/setSetType : Number | |
function getSetType() / function setSetType(value) |
getGradientFill : GradientFill | |
function getGradientFill() |
getTextureFill : TextureFill | |
function getTextureFill() |
getSolidFill : SolidFill | |
function getSolidFill() |
getPatternFill : PatternFill | |
function getPatternFill() |
getGradientColorType : Number | |
function getGradientColorType() |
getGradientStyle : Number | |
function getGradientStyle() |
getGradientColor1 : Color | |
function getGradientColor1() |
getGradientColor2 : Color | |
function getGradientColor2() |
getGradientDegree : Number | |
function getGradientDegree() |
getGradientVariant : Number | |
function getGradientVariant() |
getPresetColor : Number | |
function getPresetColor() |
getTexture/setTexture : Number | |
function getTexture() / function setTexture(value) |
getPattern/setPattern : Number | |
function getPattern() / function setPattern(value) |
getPictureFormatType/setPictureFormatType : Number | |
function getPictureFormatType() / function setPictureFormatType(value) |
getScale/setScale : Number | |
function getScale() / function setScale(value) |
getImageData/setImageData : byte[] | |
function getImageData() / function setImageData(value) |
Method Detail |
---|
setOneColorGradient | |
function setOneColorGradient(color, degree, style, variant) |
color: Color
- One gradient color.degree: Number
- The gradient degree. Can be a value from 0.0 (dark) through 1.0 (light).style: Number
- A variant: Number
- The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.setTwoColorGradient | |
function setTwoColorGradient(color1, color2, style, variant) |
color1: Color
- One gradient color.color2: Color
- Two gradient color.style: Number
- A variant: Number
- The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.setTwoColorGradient | |
function setTwoColorGradient(color1, transparency1, color2, transparency2, style, variant) |
color1: Color
- One gradient color.transparency1: Number
- The degree of transparency of the color1 as a value from 0.0 (opaque) through 1.0 (clear).color2: Color
- Two gradient color.transparency2: Number
- The degree of transparency of the color2 as a value from 0.0 (opaque) through 1.0 (clear).style: Number
- A variant: Number
- The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.setPresetColorGradient | |
function setPresetColorGradient(presetColor, style, variant) |
presetColor: Number
- A style: Number
- A variant: Number
- The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.