Plot Over Time
I ran across Tom Fotherby’s Fotherplot when I was looking for a slick way to set up graphs for a workout log. Being the type that can’t stand to leave things alone, I had to hack on it a bit to change a few things… upgrade it to the most modern version of Google Chart Tools, add multiple data points
I ran across Tom Fotherby’s Fotherplot when I was looking for a slick way to set up graphs for a workout log. Being the type that can’t stand to leave things alone, I had to hack on it a bit to change a few things… upgrade it to the most modern version of Google Chart Tools, add multiple data points, etc… until finally, well… I think the only thing left of the original plugin is the GNU license.
Want to see it in action? I’m using it in http://www.midnightryder.org/category/workout-log/
To get it up and running: first, you’ll need to put data in your posts. So, in a post, go to the section under your post called “Custom Fields”. Create a field you want to track (for instance, “Heart Rate”) and give it a value.
You’ll need at lest two posts with data in them before Plot Over Time can do it’s thing – so add data to another post.
Now that you have at least two posts with data, you can create a post that creates a graph. For this example, you could simply use:
[plotovertime field1="Heart Rate"]
This will go through all posts that have a custom field called “Heart Rate” and plot them on a nice Google Chart Tools LineChart. If you wanted to work with more points of data, simply add more Custom Fields:
[plotovertime field1="Heart Rate" field2="Weight" field3="Workout Time"]
Plot Over Time support up to 10 fields per graph.
The legend is automatically added, and each datapoint is able to be clicked to get a callout about it’s datapoint. If you want to get rid of the legend:
[plotovertime field1="Heart Rate" legend="none"]
Or you can move the legend around with legend=”left” or legend=”right”.
To use other types of graphs:
[plotovertime field1="Heart Rate" type="BarChart"]
Valid types chart types for Plot Over Time are: AreaChart, LineChart, PieChart (not particularly useful in this implementation), BarChart, and ColumnChart.
You can set your own width and height for the chart with Width and Height:
[plotovertime field1="Heart Rate" width="500" height="300"]
By default, Plot Over Time uses ALL data from all posts and pops it onto a graph. You can limit it with two options:
1) You can determine the maximum number of days worth of data (starting from now and going backwards) with maydays:
[plotovertime field1="Heart Rate" maxdays="30]
This would show a one month span of data.
2) You can attach a graph to that post’s published date with usepostdate: