Home Plugins wp custom field chart
Wp Custom Field Chart logo

Wp Custom Field Chart

by showi on WordPress.org

Make chart from custom field attached to your post/page using Chart.js javascript library.

(0)
One field for each chart (Two tags)

One field for each chart (Two tags)

This plugin collect data attached to post/article via custom field and make
chart of it.
This plugin use Chart.js for chart drawing ChartJs

Data are collected by looking for specific custom field attached to your
post/page. You can change aggregation method, intervall…

See usage

Usage

Edit your post/page in text mode and put some Javascript and a WordPress tag

Minimum


[custom_field_chart fields="humidity" js_data="mydata"]

For each field you need to put empty {} into datasets.

For two fields:


[custom_field_chart fields="humidity,temperature" js_data="mydata"]

But it’s pretty useless to put more than one field without different colors 🙂

More



[custom_field_chart width="1000" height="300"
  kind="line" method="track" interval="day" interval_count="31" 
  fields="humidity,temperature" js_data="mydata" js_options="myopts"]

Notes

  1. js_data and js_options must reflect name given to your javascript variable.
  2. Look at http://chartjs.org/ for documentation
  3. You don’t need to supply labels and data (like in chartjs.org example) 🙂

Tag attributes

= Required =
1. fields: Custom field separate by comma
1. js_data: Name of javascript variable holding chart datasets

Optional

  1. width: Chart width (default: 400)
  2. height: Chart Height (default: 200)
  3. method: Aggregate method track, delta or cumulative (defaul: track)
  4. interval: year, month, day (default: day)
  5. interval_count: How many year, mont or day (default: 31)
  6. js_options: Name of javascript variable holding chart options
  7. kind: Chart type line or bar (default: line)
  8. to_date: Current date by default, post date if ‘post’ specified else value supplied
  9. dump: Dumping attributes for debug (default: False)
  10. round: Rounding data with specified precision

Note

Beta software… Interface may change.

Active installations10+
Weekly downloads
8+0.00%
Version0.0.5
Last updated8/18/2014
WordPress version3.9.1
Tested up to3.9.40
Tags
chartcustom fieldjavascript