Linux 软件免费装
Banner图

Blazing Charts

开发者 massoudshakeri
更新时间 2018年3月23日 15:35
PHP版本: 3.0.1 及以上
WordPress版本: 4.9.4
版权: GPLv2 or later
版权网址: 版权信息

标签

maps charts javascript charts javascript maps graph highcharts morris.js zingchart chart.js google charts d3.js chartist.js smoothie charts flot

下载

1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6

详情介绍:

We are not going to re-invent the wheel, and this plugin is not going to give you another charting library. This purpose of this plugin is to let you get the most out of charting libraries that already exist and are awesome. There are many of them out there, and most of them are free. Many of the other commercial libraries are free for a personal or non-profit project, or have a free branded version, which may have a small link to their website. Here is a list of libraries currently added to the collection. If you know another charting library, compatible with GPL license, please inform us to add it. Please refer to the license page of a library you want to use to check the precise license conditions. What does this plugin do? This plugin allows you to create chart code snippets, which can be inserted into the posts or pages by using the shortcode of "BlazingChart". Another scenario is you have a function, defined in another plugin or in your theme, which extracts data from database and produces the scripts for the chart. Then you can give the name of that function as a parameter to the shortcode, so the function is called and the output of that function will be inserted in the page. The "BlazingChart" shortcode can have up to 4 parameters:
  1. "charttype": The first parameter of that shortcode tells which Charting library you want to use. At the moment the value of this parameter can be one of these:
  2. highcharts: for HighCharts.js
  3. morris: for Morris.js
  4. zingchart: for ZingChart
  5. chartjs: for Chart.js
  6. google: for Google Charts
  7. d3: for D3.js
  8. chartist: for Chartist.js
  9. smoothie: Smoothie Charts
  10. flot: for Flot library
Other than Google Charts which does not have a local version of library, all the other libraries are included in this plugin. Some of them are hosted on a CDN as well. So by changing the settings, you can easily switch between remote or local chart/map libraries.
  1. "source": The second parameter specifies the user-friendly slug of the chart snippet as the source of script and data for the chart.
  2. "function": If a function, defined in another plugin or in the theme, is going to produce the data and script for the chart, the name of that function can be given as the value of this parameter. This value can be not only a function name, but also other types of callbacks, like "Foo::method", "array('Foo', 'method')", or "array($obj, 'method')".
  3. "options": Some of the charting libraries are just a single file. But others, like Flot, are divided to a main library and several auxiliary libraries, to make it lighter and more efficient. By using this parameter, you can give a comma separated list of auxiliary libraries of the main library to load. Here is the list of options for each library:
  4. HighCharts.js: more, 3d, exporting
  5. D3.js : pie, nvd3
  6. Chart.js : bundle
  7. Flot Charts : colorhelpers, canvas, categories, crosshair, errorbars, fillbetween, image, navigate, pie, resize, selection, stack, symbol, threshold, time
How Charting libraries are used? To include JavaScript files efficiently, none of these libraries are enqueued, until the shortcode of "BlazingChart" appears in a post or a widget. The plugin loads only one of these libraries, specified by "charttype" parameter. Moreover, to load the page faster, that library is loaded in the footer. You can also use a built-in PHP function to invoke the chart anywhere in your template: <?php // define the parameters $patts= array( "charttype" => "name of one of the aforementioned charting libraries", "source" => "slug of the chart snippet", "options" => "auxiliary libraries to load" ); // call the function to invoke the shortcode handler blazing_charts_insert($patts); ?> As always, there are exceptions: To reduce the size of the libraries loaded for Google Charts, that library decides which portions of the library to be included, depending to the type of the chart. So the link to the CDN library must be included at the top of the script, saved in the chart snippet. How To use this plugin:
  1. Although theoretically you can have various charts in a single page, drawn by more than one charting library, it is advisable not to do that. These libraries may conflict with each other, and may not get any of the charts drawn properly. Just make sure in every page, only one of those libraries is included.
  2. Every chart has two major parts: first a container, specified by a <div> or <canvas> tag, with a certain id or class; and second a script which tells how that chart should be drawn.
  3. If you have more than one chart in a single page, make sure each chart, saved as a Chart Snippet or produced by a function, has a unique id or class for its container. Otherwise there will be a conflict between those charts.
  4. Shortcodes are case-sensitive. So if you want to use the shortcode of [BlazingChart], please make sure to type it correctly.
比如 I tried to bring some examples about each of the libraries, in this plugin's URI: http://blazingspider.com/wp-demo 程序文档 The detailed and updated version of documentation can be found in this link: http://blazingspider.com/plugins/blazing-charts

安装:

  1. If you choose to install in manually, make sure all the files from the downloaded archive to be uploaded to the '/wp-content/plugins/blazing-charts/' directory.
  2. 通过WordPress的的“Plugins”菜单激活插件

屏幕截图:

  • Where to find plugins' Settings page.
  • Chart Snippets Post Type, which conatain HTML, javascripts, and styles for each chart or map.
  • A D3.js Example, drawn using this plugin.
  • A Line chart drawn using Flot Charts library

升级注意事项:

1.0
  • First Release.
1.0.3 Updated chart.js charting library to the latest version. Be prepared to rewrite all your scripts using that library. 1.0.4 Updated Settings page to highlight that HighCharts and ZingChart are not enabled by default. 1.0.5 Changed Flot CDN to Cloudflare. Changed HighCharts CDN url to protocol-relative. 1.0.6 Removed all the commented lines which references to local highcharts libraries, to prevent Wordpress plugin alarms triggered

常见问题:

What if I want to use a different version of those libraries locally?

In that case, please upload it to the related foler of "js" folder of this plugin, and keep the same naming convention for the library.

更新日志:

1.0.6 Removed all the commented lines which references to local highcharts libraries, to prevent Wordpress plugin alarms triggered 1.0.5 Changed Flot CDN to Cloudflare, the original CDN is not there any more. Changed HighCharts CDN url to protocol-relative. 1.0.4 1.0.3 1.0.2 1.0.1 1.0