开发者 | YSH |
---|---|
更新时间 | 2016年8月9日 23:21 |
PHP版本: | 2.5 及以上 |
WordPress版本: | 4.4 |
版权: | GPLv2 |
版权网址: | 版权信息 |
[linechart minx="1950" maxx="1965" miny="0" maxy="100" steps="false" fill="true" points="false" legend="true"] { label: "Series 1", data: [[1963, 43], [1959, 48], [1956, 50], [1952, 30]] }, { label: "Series 2", data: [[1952, 30], [1956, 49], [1959, 49], [1963, 50]] } [/linechart]
Pie chart example:
[piechart donut="0.5"] { label: "Series1", data: 10}, { label: "Series2", data: 30}, { label: "Series3", data: 90}, { label: "Series4", data: 70}, { label: "Series5", data: 80}, { label: "Series6", data: 110} [/piechart]
Bar chart example:
[barchart] { label: "Bars", data: [[1, 6],[2, 4],[3, 5],[4, 6],[5, 14],[6, 5],[7, 12]] }, { label: "More bars", data: [[1.5, 3],[2.5, 3],[3.5, 15],[4.5, 3],[5.5, 10],[6.5, 11],[7.5, 10]] } [/barchart]
Please note that in Flot, a bar chart reacts like a line chart. If you have two data series with similar positions on the x-axis, they will overlap instead of showing side by side. Also, you need both values to be a number, no text.
Flot supports much more advanced graphs than are supported with these shortcodes, but you can add these manually. If you set the custom field 'flot' to 'yes', the plugin will load Flot for you. You can then just add your own javascript code in the editor. Check the Flot websites for a number of examples.