=== Plugin Name === Contributors: tfotherby Tags: graph,chart,custom fields,google chart API, Requires at least: 2.0 Tested up to: 2.7 Stable tag: 0.0.3 A function for listing and plotting your data against time using the Google charts API. == Description == After [working out how to plot time-based data using Google charts API](http://www.tomfotherby.com/blog/index.php/2009/01/how-to-plot-dates-in-google-charts-api/ "A post from my blog"), I created a Wordpress plugin to plot values stored in a custom field against the published-on date of a Wordpress blog post. == Installation == 1. Download the **fotherplot** plugin and you will get a directory called "fotherplot" when you unzip the downloaded file. Upload the "fotherplot" directory to your wordpress plugins directory (e.g. `/wp-content/plugins/`) 1. Activate the plugin through the 'Plugins' menu in the Wordpress dashboard. 1. Decide what the name of the custom field that you want to plot is going to be. The default setting is called "Weight (kgs)" but you can use any custom field name. 1. If no posts exist that use the custom field, create a couple of posts with different publish dates and fill in a value for the custom field. 1. To display the graph on your blog see http://wordpress.org/extend/plugins/fotherplot/faq/ == Screenshots == 1. This screenshot is an Example of the chart the plugin produces. == Frequently Asked Questions == = How do I display the fotherplot chart on my blog? = You have two options to display the fotherplot chart: 1. If you want to display it on a page: 1. Copy the `page_fotherplot.php` page template from the plugin directory to the folder of the theme you're currently using (`/wp-content/themes//`) and edit the file to change the custom field name in the `plotDataAgainstTime()` function to the name of the custom field you will be using. 1. From the Wordpress dashboard, create a new page. 1. From the "Template" dropdown in the sidebar, select "Fotherplot". 1. Use preview to check it works (remember you need to have a couple of values input before you'll see a chart). 1. If you want to display it somewhere specific: 1. Install the [phpexec.php](http://wordpress.org/extend/plugins/exec-php/ "The phpexec.php plugin") plugin so you can run PHP code from pages and posts. Activate this plugin from the dashboard. 1. To plot the chart, in one of your pages or posts, put the following: ``. You can just display the chart or just the data list (or both). See the parameter options: http://wordpress.org/extend/plugins/fotherplot/other\_notes/. = What are the parameters that can be passed to the "plotDataAgainstTime()" function? = 1. Parameter 1: name of custom field 1. Optional Parameter 2: Text to show on Y axis. Defaults to "Kgs". 1. Optional Parameter 3: Whether to show graph. 1=yes, 0=no. Defaults to 1. 1. Optional Parameter 4: Whether to show list of custom values. 1=yes, 0=no, Defaults to 1. Examples: ` ` == Changelog == 1. v0.0.1 - Inital draft version (Not in proper Wordpress plugin format) 1. v0.0.2 - First Wordpress plugin version. Two features: 1) Draw chart of custom field valid over time. 2) Display list of values in time order. 1. v0.0.3 - No functionality change but added a dummy page template so it's possible to use the plugin without installing the `phpexec' plugin. == Usage Example == I use this plugin to keep a track of my weight. I have a private Wordpress journal with a custom field called "Weight (kgs)" and each week when I make my journal entry I fill in my weight in this custom field. I have page called "My Weight" which is empty but uses the **Fotherplot** Template. The plugin outputs [a image](http://chart.apis.google.com/chart?&cht=lxy&chs=450x300&chma=10,10,10,10&chds=0,364,98.9,116.1&chg=0,5&chxt=y,x&chxl=0:|98.9|102.34|105.78|109.22|112.66|116.1|1:|20/Jan/08|11/Feb/08|17/Jul/08|18/Oct/08|10/Jan/09&chm=D,FF0000,0,-1,1|o,000000,0,-1,4|N,000000,0,-1,9&chd=t:0,8,15,22,50,79,180,224,263,273,290,350,357,364|103.4,102.9,102.3,100.9,99.3,98.9,103.4,110.5,112.9,109.7,110,116.1,113.4,110.67 "Generated from Google Charts API") and a list of the relevant data: