Skip to content

Instantly share code, notes, and snippets.

@skarred
Last active December 25, 2015 04:18
Show Gist options
  • Save skarred/6915948 to your computer and use it in GitHub Desktop.
Save skarred/6915948 to your computer and use it in GitHub Desktop.
YUI3 WordPress Plugin Example: Using the [yuichart] shortcode to generate a multi-series line chart on a WP page or post.

A Multiple Series Chart

[yuichart  
	title = 'Five-Year Sales by Month'
		filename = 'test3.csv'
		type = 'combo'
		categorytype = 'category'
		cataxtitle = 'Month'
		catlabelrotation = '0'
		vax1title = 'Sales'
		vax1labelrotation = '0'
		vax1prefix = '\$'
		vax1suffix = '	'
		vax1decimalplaces = 0
	 	showareafill = 1
		showlines = 1 
		showmarkers = 1
		showlegend = 1
		hgridlines= 1
		vgridlines= 1
]  

and the data file combo.csv (below) will render the following chart:
Pie Chart

Period Year 1 Year 2 Year 3 Year 4 Year 5
Jan 47413 55220 39875 32180 62377
Feb 56645 57350 64128 38600 66501
Mar 29881 15445 47653 25020 31404
Apr 39658 27776 36504 51300 36504
May 27361 21408 16888 31790 16888
Jun 19611 17118 17118 32100 18909
Jul 39639 18028 18028 59832 35500
Aug 37101 19883 19883 30740 51250
Sep 30036 15796 22105 47800 34443
Oct 59248 53665 41350 73890 68088
Nov 64418 83269 46024 60202 68175
Dec 57787 72991 41856 55200 61100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment