Fotherplot

توسط

After working out how to plot time-based data using Google charts API, 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.

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 and a list of the relevant data, example:

  • January 17, 2009: 110.67kgs
  • January 10, 2009: 113.4kgs
  • January 3, 2009: 116.1kgs
  • November 5, 2008: 110kgs
  • October 18, 2008: 109.7kgs
  • October 8, 2008: 112.9kgs
  • August 30, 2008: 110.5kgs
  • July 17, 2008: 103.4kgs
  • April 8, 2008: 98.9kgs
  • March 10, 2008: 99.3kgs
  • February 11, 2008: 100.9kgs
  • February 4, 2008: 102.3kgs
  • January 28, 2008: 102.9kgs
  • January 20, 2008: 103.4kgs
  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/)
  2. Activate the plugin through the ‘Plugins’ menu in the WordPress dashboard.
  3. 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.
  4. To display the graph on your blog see https://wordpress.org/extend/plugins/fotherplot/faq/

سوالات متداول

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 three options to display the fotherplot chart on the public side of your blog:

  1. To display the chart on any post or page, simple embed the text “[fotherplot]” into the content. The tag will be replaced with the chart image.
  2. 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/<currentThemeName>/).
    2. From the WordPress dashboard, create a new page.
    3. From the “Template” dropdown in the sidebar, select “Fotherplot”.
    4. Use preview to check it works (remember you need to have a couple of values input before you’ll see a chart).
  3. An alternative method to display the chart somewhere specific (e.g. in a post):
    1. Install the phpexec.php plugin so you can run PHP code from pages and posts. Activate this plugin from the dashboard.
    2. To plot the chart, in one of your pages or posts, put the following: <phpcode><?php echo plotDataAgainstTime(); ?></phpcode>. 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).
  2. Optional Parameter 3: Whether to show chart image. 1=yes, 0=no. Defaults to yes.
  3. Optional Parameter 4: Whether to show list of custom values. 1=yes, 0=no, Defaults to yes.
    1. Examples:
    2. You can also use the same parameters in the shortcode: [fotherplot customfieldname="mycustomfield" showgraph=1 showlist=1].
×
نظری برای این آیتم موجود نیست.
0 0 رای ها
امتیازدهی
اشتراک در
اطلاع از
0 نظرات
قدیمی‌ترین
تازه‌ترین بیشترین رأی
بازخورد (Feedback) های اینلاین
مشاهده همه دیدگاه ها
نسخه حجم فایل SHA256 تغییرات دانلود
0.0.9 93 کیلوبایت -
دانلود
×
★★★★★
★★★★★
5.0 /5 (1 نظر)

قیمت:

رایگان

نگارش

0.0.9

آخرین انتشار

1 خرداد 1405

آخرین بروزرسانی

4 هفته پیش

نصب های فعال

10+

نگارش وردپرس

وردپرس 2.5+

تست شده از نسخه

وردپرس 3.3.2

نگارش PHP

-

نسخه ها

1 نسخه