JSON API - addChart
- getTemplateVariables
- getTemplateVariablesType
- processTemplate
- removeVariableAudio
- removeVariableImage
- removeVariableText
- removeVariableVideo
- replaceVariableAudio
- replaceVariableHtml
- replaceVariableImage
- replaceVariableList
- replaceVariablePptxFragment
- replaceVariableTable
- replaceVariableText
- replaceVariableVideo
- setTemplateSymbol
addChart
PREMIUM
TRIAL / ADVANCED
Inserts a chart.
Note
You are reading the JSON API documentation. For the PHP API method please go to addChart.
JSON data
| Key | Description |
|---|---|
| data | This array should contain the legends and data and to be added to the chart. |
| type | The possible values are:
|
| coordinateX | EMUs (English Metric Unit). |
| coordinateY | EMUs (English Metric Unit). |
| sizeX | EMUs (English Metric Unit). |
| sizeY | EMUs (English Metric Unit). |
| name | Internal name. If not set, a random name is generated. |
| order | Set the display order. Default after existing contents. 0 is the first order position. If the order position doesn't exist add after existing contents. |
| title | The chart title. |
| color | Color scheme. |
| font | The font to be used. Arial, Calibri... |
| trendline | Adds trendlines. Compatible with line, bar, col and area 2D charts. Possible keys and values are:
|
Chart display properties
| Key | Description |
|---|---|
| axPos | Position of the axis (r, l, t, b). Each value of the array for each position (if a value is null avoids adding it). |
| formatCode | Number format. |
| formatDataLabels | Possible keys and values are:
|
| haxLabel | Label for the horizontal axis. |
| haxLabelDisplay | How to display the label of the horizontal axis. Possible values are: vertical, horizontal, rotated. |
| hgrid | Horizontal grid. Possible values are:
|
| majorUnit | Major unit value for bar, col, line, area, radar and scatter charts. |
| minorUnit | Minor unit value for bar, col, line, area, radar and scatter charts. |
| orientation | Orientation of the axis, from min to max (minMax) or max to min (maxMin). Each value of the array for each axis (if a value if null avoids adding it). |
| scalingMax | Scaling max value for bar, col, line, area, radar and scatter charts. |
| scalingMin | Scaling min value for bar, col, line, area, radar and scatter charts. |
| stylesTitle | Possible keys and values are:
|
| vaxLabel | Label for the vertical axis. |
| vaxLabelDisplay | How to display the label of the vertical axis. Possible values are: vertical, horizontal, rotated. |
| vgrid | Vertical grid. Possible values are:
|
The available parameters to display legends and data include
| Key | Description |
|---|---|
| legendOverlay | If true the legend may overlay the chart. This option may hinder the legibility of the data so it is only recommended if it is crucial to "save space". |
| legendPos | The possible values are:
|
| showCategory | If true shows the categories inside the chart. |
| showLegendKey | If true shows the legend values. |
| showPercent | If true shows the percentage values. |
| showSeries | If true shows the series values. |
| showTable | If true shows the chart data in an associated table. |
| showValue | If true shows the chart data values. |
Further configuration options for specific chart types
| Key | Description | |
|---|---|---|
| Bar and column charts | ||
| gapWidth | Gap width. | |
| groupBar | Different ways to group data. Possible values are: clustered, stacked, percentStacked and standard. | |
| overlap | Overlap. | |
| tickLblPos | Tick label position: nextTo, high, low, none. If string, uses default values. If array, sets a value for each position | |
| Pie and doughnut charts | ||
| explosion | Distance among different sectors. | |
| holeSize | Size of the inner hole (only doughnut charts). | |
| ofPieCharts: pie of pie and bar of pie charts | ||
| custSplit | Custom split. Array (zero based) of values that goes in the second chart. For example: [3,4,7] will pick the fourth, fifth and eighth value. | |
| gapWidth | Distance between the two charts. | |
| Line and scatter (XY) charts | ||
| smooth | If true it smooths the line. "0" forces disabling it | |
| symbol | The possible symbol values are:
|
|
| symbolSize | The size of the symbol used. | |
Additional available options for 3D charts
| Key | Description |
|---|---|
| perspective | Perspective angle. Angles beyond 25 degrees provoke a big distortion in the 3D chart representation. |
| rotX | Rotation angle with respect to the vertical axis. Standard values are between 10 and 20 degrees. |
| rotY | Rotation angle with respect to the horizontal axis. Standard values are between 10 and 20 degrees. |
Theme options
| Key | Description |
|---|---|
| chartArea | backgroundColor |
| gridLines |
|
| horizontalAxis |
|
| legendArea |
|
| plotArea | backgroundColor |
| serDataLabels |
|
| serRgbColors | series colors |
| valueDataLabels |
|
| valueRgbColors | values colors |
| verticalAxis |
|
Code samples
Example #1
Release notes
- phppptx 5.0:
- new action.