[WordPress] 外掛分享: Plot Over Time

前言介紹

  • 這款 WordPress 外掛「Plot Over Time」是 2011-11-21 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2011-11-22,距離現在已有 4912 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
  • 有 1 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

midnightryder |

外掛標籤

chart | graph | custom fields | weight tracking | google chart API |

內容簡介

我在尋找一種炫酷的方式來建立健身日誌的圖表時發現了Tom Fotherby的Fotherplot。 作為那種不能忍受不改變任何事情的人,我必須對它進行一些修改......將它升級到最現代的Google Chart Tools版本、添加多個數據點等等......最後,唯一剩下的原始外掛應該只有GNU許可證了。

想看它動起來嗎?我正在http://www.midnightryder.org/category/workout-log/使用它。

要啟動它:首先,您需要將數據放入您的文章中。因此,在發布文章時,進入您的文章下方的“自定義字段”部分。創建您要跟踪的領域(例如,“心率”)並給它一個值。

在Plot Over Time進行操作前,您需要至少有兩個帶有數據的帖子-因此請向另一個帖子添加數據。

現在,您至少有兩個帶有數據的帖子,可以創建一個帖子來創建圖表。對於此示例,您可以簡單地使用:

[plotovertime field1="心率"]

這將遍歷所有具有名為“心率”的自定義字段的帖子並將它們繪製在漂亮的 Google Chart Tools LineChart 上。如果您想使用更多的數據點,只需添加更多自定義字段:

[plotovertime field1="心率" field2="體重" field3="訓練時間"]

Plot Over Time支持每個圖表最多10個字段。

圖例會自動添加,可以單擊每個數據點以獲取有關其數據點的提示。如果要去除圖例:

[plotovertime field1="心率" legend="none"]

或者,可以使用legend =“left”或legend =“right”移動圖例。

要使用其他類型的圖表:

[plotovertime field1="心率" type="柱狀圖"]

Plot Over Time 的有效圖表類型是:AreaChart、LineChart、PieChart(在此實現中不是特別有用)、BarChart和ColumnChart。

您可以使用 Width 和 Height 為圖表設置自己的寬度和高度:

[plotovertime field1="心率" width="500" height="300"]

默認情況下, Plot Over Time會使用所有帖子中的所有數據並將其彈出到圖表上。您可以使用兩個選項來限制它:

1)您可以使用maydays來確定最多幾天的數據(從現在開始向後計算):

[plotovertime field1="心率" maxdays="30]

這將顯示一個月的數據範圍。

2)您可以使用usepostdate將圖表附加到該帖子的發布日期:

[plotovertime field1="心率" usepostdate="true"]

因此,如果帖子已經存在3周,它只會顯示該帖子在三週前和之前的數據。

日期格式默認為m/d/y-例如,12/31/11。您可以使用dateformat更改它:

[plotovertime field1="心率" dateformat="Y-m-d"]

這會將2011-12-31放在圖表上。

最後:不喜歡圖表的顏色或想添加一些新選項?沒問題-可以使用option參數使用任何Google Visualization Tools選項:

[plotovertime field1="心率" options="title: 'My Cool Graph!';"]

這將在您的圖表上方添加一個標題,標題為“My Cool Graph!” 。注意-不要使用options =“height:”,而應使用height =“300”或類似的更改高度和寬度。將其更改為傳遞的選項是一個錯誤的做法。

原文外掛簡介

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:
[plotovertime field1="Heart Rate" usepostdate="true"]

So if the post was 3 weeks old, it would only show data from it’s publication date of three weeks ago and older.
The date format defaults to m/d/y – IE, 12/31/11. You can change it with dateformat:
[plotovertime field1="Heart Rate" dateformat="Y-m-d"]

Would instead put 2011-12-31 on the graph.
And finally: Don’t like the colors of the graph, or want to add a few new options? No problem – any Google Visualization Tools options is available using the option parameter:
[plotovertime field1="Heart Rate" options="title: 'My Cool Graph!';"]

This would add a title above your graph that reads “My Cool Graph!”. Note – don’t change the height or width using the options=”height: “, instead use height=”300” or similar. Changing it in the options that are passed to the graph won’t change the size of the div it exists in.
For more information on the options available visit the Google Chart Tools homepage: http://code.google.com/apis/chart/index.html
And of course, you can mix and match any of the shortcode commands in any way you want. have fun!
Now, about that data… you’ll want to know a couple of rules.
First, if you define 5 fields you want to read from, and a post only had four fields? It’s going to ignore you.
Second, it doesn’t do data interpolation. If there’s a gap in your data, it simply ignores it – it doesn’t give it a “0”, it just plain doesn’t plot it. (That’s how I wanted it. Other opinions may differ.)
Third, if you tell it you want to see 30 days of data, and you’ve only got three days of data in your posts? It’s only going to show a graph that spans three days.
All data integrity is up to you.
And it will pull data from ALL posts, not just posts in a specific category. For future updates I’ll probably add a category field that allows you to pull data from a single category.
This plugin is a quick “one off” I did for myself – it’s not nearly as pretty or efficient as it could be, and I’ll probably do some refactoring on it in the future if there’s any interest. Plus, there’s probably a couple of other things I’ll add down the road as the whim strikes.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Plot Over Time」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


最新版本

延伸相關外掛(你可能也想知道)

  • Advanced Custom Fields (ACF®) 》Advanced Custom Fields 可以讓 WordPress 網站成為一個完整的內容管理系統,提供您所有工具以更好管理您的數據。, 使用 Advanced Custom Fields 外掛,完全...。
  • Meta Box 》Meta Box 是一個強大、專業又輕量級的工具組,供開發者在 WordPress 中為任何自訂文章型別建立自訂的 Meta Box 與自訂欄位。, 透過 Meta Box,您可以使用超過...。
  • Checkout Field Editor (Checkout Manager) for WooCommerce 》WooCommerce 結帳欄位編輯器外掛, WooCommerce 結帳欄位編輯器 (Checkout Manager) 外掛讓您可以在結帳頁面上添加 20 種不同類型的自訂欄位,並搭配直覺且易...。
  • Pods – Custom Content Types and Fields 》使用「Pods Framework」在一個地方管理你所有自訂內容需求。, , , 建立內容類型,包括自訂文章類型、自訂分類、以及我們專屬的「進階內容類型」(ACT),...。
  • Flexible Checkout Fields for WooCommerce – WooCommerce Checkout Manager 》我們認為 WooCommerce 是 WordPress 最好的電子商務外掛,但它缺乏一些非常基本的功能,例如使用易於使用的接口自定義結帳管理器來自訂結帳欄位。您可以使用 ...。
  • Advanced Custom Fields: Extended 》🚀 全方位增強套件,可改進WordPress和Advanced Custom Fields。此外掛旨在提供一個強大的管理框架,涵蓋了眾多改進和優化。, 此外掛需要至少 ACF Pro 5.8。,...。
  • Sydney Toolbox 》Sydney Toolbox 外掛只適用於 Sydney WordPress 主題。, 此外掛註冊了在 Sydney 主題 中所需的自定義文章類型和自定義欄位。。
  • Custom Field Suite 》Custom Field Suite (CFS) 讓您為文章添加自定義欄位。它輕量級且經過過往使用者的測試(很難出現錯誤)。, 需要了解的事項, , 我們不提供支援。, 這是一個免...。
  • Custom Field Template 》「Custom Field Template 外掛」在「編寫文章/頁面」時,新增自訂欄位的預設設定。這個模板格式基本上跟「rc:custom_field_gui 外掛」差不多,不同處在於:, ...。
  • Custom Post Types and Custom Fields creator – WCK 》WordPress Creation Kit 是由三個工具組成,可幫助您建立和維護自訂文章類型、自訂分類和最重要的是文章、頁面或自訂文章類型的自訂欄位和元框。, WCK Custom...。
  • Secure Custom Fields 》總結:SCF 是一款能夠擴展 WordPress 功能的外掛,使其成為一個靈活的內容管理工具。透過 SCF,管理自定義數據變得簡單高效。, , 1. 為什麼 SCF 是一個靈活的...。
  • JSM Show Post Metadata 》JSM's Show Post Metadata外掛會在文章編輯頁面底部顯示文章(例如文章、頁面和自訂文章類型)的meta key(也就是自訂欄位名稱)和它們的非序列化值。, ...。
  • Advanced Custom Fields: Nav Menu Field 》使用 Nav Menu Field 外掛將導覽選單加入Advanced Custom Fields (ACF)。此外掛會在 ACF(版本 5 和 4)加入 Nav Menu 欄位類型,讓您從 WordPress 管理後台...。
  • Frontend Admin by DynamiApps 》這個外掛讓你可以在前端編輯及新增文章、頁面、使用者、專有名詞欄位等等。 (之前稱為 ACF Frontend), 這個外掛允許你在網站上顯示前端管理表單,讓使用者可...。
  • Simple CSV/XLS Exporter 》本外掛可以讓您透過簡單的連結/按鈕,從後端或前端匯出文章為 CSV 或 XLS 檔案。, 請確保您使用 PHP 7.3 或更新版本,如果您看到任何錯誤,舊版本將不再受支...。

文章
Filter
Apply Filters
Mastodon