Thanks for the kind words on the blog.
I’m not an expert on WordPress, php, etc. but this is what I learned to hack together a graph using flot and this plug-in via trial and error.
There are two files you’ll be dealing with, the first being flot-for-wp.php. As I understand it, this is where you let WordPress know where the supporting files are for the plugin (e.g. jquery.flot.min.js, etc.). This is done during installation so nothing to do here.
This is also where you let WordPress know where the file contains the necessary html, css, and javascript to build your graph. In essence the file you’ll be creating that will contain the graph. For example:
include ( plugin_dir_path( __FILE__ ) . ‘flot/gdp.php’);
I originally copied whatever example file is in the default installation (I think it’s named flot-example.php). This file basically echoes via php all of the html, css, and javascript necessary to build the graph and creates the short code.
In case you didn’t know what a short kid is (I didn’t), it’s a string between two brackets (e.g. -> [gdp_sc] that “points” to, in my example, gdp.php. The short code is actually placed in your post and then WordPress substitutes the short code for whatever is in the file you are pointing to.
At the bottom of flow-example.php you’ll notice this line:
add_shortcode( ‘flot_example_sc’, ‘flot_example’ );
So this links the short code (flot_example_sc] with your file flot_example.
In sum, you need to:
– Create a file that contains the graph
– Add a short code to the bottom of that file
– Add a line in flot-for-wordpress.php that points to the file that contains your graph.
I hope this helps and feel free to ask any follow-up questions.