Insert a Bar Chart in a WordPress Post or Page with a Shortcode

In addition to Pie and Donut plots, iLecture’s gCharts Plugin can also render Bar Charts (both vertical and horizontal) in (individual) WordPress posts and pages.

In the example shown below, the Google Column Chart was generated from a simple WordPress Shortcode:

Customizing colors

You just need to insert an additional column, 'Color':

There are three different ways to choose the colors:

  • RGB values'#b87333'
  • English color names: 'silver'
  • CSS-like declaration: 'color: #e5e4e2'

Horizontal bars?

You can switch from a Column Chart (vertical bars) to a Bar Chart (horizontal bars) by setting the type attribute to "bar":

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.