Practical phppptx

Charts

Introduction

Working with charts is as easy as with other contents. You just need to choose the chart type to insert and add the values and legends.

There are 2D and 3D graphic available with many formats: bar, col, doughnut, line, pie...

Premium licenses include additional options to assign sophisticated styles such as defining custom and individual colors for series and values, adding color backgrounds and applying styles to axes.

Adding charts

For adding charts in the active slide, call addChart:

This method includes the following parameters:

  • $chart: chart type (area, bar, bar3D, bubble, col, col3D, doughnut, line, line3D, pie, pie3D, radar, scatter, surface...)
  • $position: a new shape is generated to add the chart. Coordinate and size values must be set.
  • $chartData: chart values.
  • $chartStyles: chart styles.
  • $options: extra options.

For example, to add a 3D pie chart:

Tips and tricks

The 'color' option of the addChart method sets a color scheme included in PowerPoint.

Premium licenses include a theme option to assign more advanced styles such as defining custom and individual colors for series and values, adding color backgrounds and applying styles to axes.

Next - HTML and CSS