=== Fotherplot === Contributors: tfotherby Donate link: http://www.amazon.co.uk/gp/registry/wishlist/5EU9QS88QKOI Tags: graph,chart,custom fields,google chart API,weight tracking,diet Requires at least: 2.0 Tested up to: 2.7 Stable tag: 0.0.4 A plugin 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 Wordpress blog posts that use the field. == 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. Do you already have some data that you want to chart contained in a custom field? If so, go to the Fotherplot settings page and specify the custom field name in the dropdown. If not, decide what the name of the custom field that you want to plot is going to be and create a couple of posts (with different publish dates) first. 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. 1. This screenshot is an Example of the plugins admin page. == Frequently Asked Questions == = How do I display the fotherplot chart on my blog? = By default the fotherplot chart is only non-publically displayed in the settings page in the Wordpress dashboard. You have two options to display the fotherplot chart on the public side of your blog: 1. If you want to display the chart 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//`). 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 the chart somewhere specific (e.g. in a post): 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 below. = What are the parameters that can be passed to the "plotDataAgainstTime()" function? = 1. Optional Parameter 1: Name of custom field. This is not necessary because by default the custom field specified in the settings page is used but you can use this if you want to override the default (i.e. Only really useful if you want to chart more than one custom field). 1. Optional Parameter 3: Whether to show chart image. 1=yes, 0=no. Defaults to yes. 1. Optional Parameter 4: Whether to show list of custom values. 1=yes, 0=no, Defaults to yes. 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 value over time. 2) Display list of values in time order. 1. v0.0.3 - Added a fotherplot page template so it's possible to use the plugin without installing the `phpexec' plugin. No functionality change in this release. 1. v0.0.4 - Added a fotherplot settings page in the Wordpress dashboard where you can specify the custom field you want to chart (Yay! no need to touch PHP code anymore). Also added some error messages: e.g. displays error if non-numeric custom field values are used, or if not enough data is input or if no custom fields are available. == 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, example: