[wordpress插件] Blazing Charts炽热的图表

wordpress 插件 文章 2020-03-06 06:30 513 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

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.

如果您知道另一个与GPL许可兼容的图表库,请通知我们添加它。

    • HighCharts.js: The library used (disabled by default) is a free version with a small link to their website, and can be used if the user’s site opts in to link.

    • HighCharts.js:使用的库(默认情况下处于禁用状态)是一个免费版本,带有指向其网站的小链接,如果用户的网站选择链接,则可以使用该库。

      This plugin does NOT substitute HighCharts terms of use.

      该插件不能替代HighCharts使用条款。

      HighCharts use is free for a personal or non-profit project under the Creative Commons Attribution-NonCommercial 3.0 License.
      Please refer to HighCharts license page http://shop.highsoft.com/highcharts.html to check the HighCharts precise

      根据Creative Commons Attribution-NonCommercial 3.0许可,HighCharts可以免费用于个人或非营利项目。

      license conditions.

    • 许可条件。

    • Morris.js
    • Morris.js

    • ZingChart: The library used (disabled by default) is a free branded version, and can be used if the user’s site opts in to link.

    • ZingChart:使用的库(默认情况下处于禁用状态)是免费的品牌版本,如果用户的网站选择链接,则可以使用该库。

      This plugin does NOT substitute ZingChart terms of use.
      Please refer to ZingChart license page https://www.zingchart.com/buy/details/branded-license/ to check the ZingChart precise license conditions.

    • 此插件不能替代ZingChart使用条款。
      请参阅ZingChart许可页面https://www.zingchart.com/buy/details/branded-license/以检查ZingChart的确切许可条件。

    • Chart.js
    • Chart.js

    • Google Charts: by loading Google’s JSAPI library loader remotely (as a service), and then using it to load the visualization library and other packages
    • Google图表:通过远程(作为服务)加载Google的JSAPI库加载器,然后使用它加载可视化库和其他软件包

    • D3.js
    • D3.js

    • Chartist.js
    • Chartist.js

    • Smoothie Charts
    • 圆滑的图表

    • Flot Charts
    • 航线图

    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”.

    此插件允许您创建图表代码段,可以使用“ 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:

    “ BlazingChart”简码最多可以包含4个参数:

      1. “charttype”:

      2. “图表类型”:

        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:

      3. 目前,此参数的值可以是以下值之一:

        • highcharts: for HighCharts.js
        • highcharts:用于HighCharts.js

        • morris: for Morris.js
        • morris:用于Morris.js

        • zingchart: for ZingChart
        • zingchart:用于ZingChart

        • chartjs: for Chart.js
        • chartjs:用于Chart.js

        • google: for Google Charts
        • google:用于Google图表

        • d3: for D3.js
        • d3:用于D3.js

        • chartist: for Chartist.js
        • 图表专家:用于Chartist.js

        • smoothie: Smoothie Charts
        • smoothie:冰沙图表

        • flot: for Flot library
        • flot:用于Flot库

        Other than Google Charts which does not have a local version of library, all the other libraries are included in this plugin.

        除了Google Charts(它没有本地版本的库)外,所有其他库都包含在此插件中。

        Some of them are hosted on a CDN as well.

        其中一些也托管在CDN上。

        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')”

            该值不仅可以是函数名称,还可以是其他类型的回调,例如“ Foo :: method”,“ array('Foo','method')”或“ 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.

            但是其他组件(例如Flot)又分为一个主库和几个辅助库,以使其更轻巧,更有效。

            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:

            这是每个库的选项列表:

            • HighCharts.js: more, 3d, exporting
            • HighCharts.js:更多,3d,导出

            • D3.js : pie, nvd3
            • D3.js:饼图,nvd3

            • Chart.js : bundle
            • Chart.js:捆绑包

            • 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.

            要有效地包含JavaScript文件,请不要将这些库排入队列,直到帖子或窗口小部件中出现“ BlazingChart”的短代码。

            The plugin loads only one of these libraries, specified by “charttype” parameter.

            插件仅加载由“ charttype”参数指定的这些库之一。

            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函数在模板中的任意位置调用图表:

            <?php

            // define the parameters

            //定义参数

            $patts= array(
                

            $ patts =数组(
                

            “charttype” => “name of one of the aforementioned charting libraries”,
                

            “ charttype” =>“上述图表库之一的名称”,
                

            “source” => “slug of the chart snippet”,
                

            “源” =>“图表摘要的子弹”,
                

            “options” => “auxiliary libraries to load”
                

            “ options” =>“要加载的辅助库”
                

            );

            );

            // call the function to invoke the shortcode handler

            //调用该函数以调用简码处理程序

            blazing_charts_insert($patts);

            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.

            要减少为Google图表加载的库的大小,该库将根据图表的类型来决定要包含的库部分。

            So the link to the CDN library must be included at the top of the script, saved in the chart snippet.

            因此,必须将CDN库的链接包含在脚本的顶部,并保存在图表摘要中。

            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

                or tag, with a certain id or class;

                每个图表都有两个主要部分:首先是由

                标记指定的具有特定ID或类的容器;

                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.

                如果单个页面中有多个图表,请确保每个图表(另存为图表片段或由函数生成)均具有其容器的唯一ID或类。

                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.

                因此,如果您想使用[BlazingChart]的简码,请确保正确输入。

              Examples

              示例

              I tried to bring some examples about each of the libraries, in this plugin’s URI:

              我试图在此插件的URI中提供有关每个库的一些示例:

              http://blazingspider.com/wp-demo

              http://blazingspider.com/wp-demo

              Documentation

              文档

              The detailed and updated version of documentation can be found in this link:

              可以在以下链接中找到文档的详细和更新版本:

              http://blazingspider.com/plugins/blazing-charts

              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.

      如果您选择手动安装,请确保已下载档案中的所有文件都上传到“ / wp-content / plugins / blazing-charts /”目录。

    2. Activate the plugin through the ‘Plugins’ menu in WordPress

      通过WordPress中的“插件”菜单激活插件

下载地址
https://downloads.wordpress.org/plugin/blazing-charts.1.0.6.zip
-EOF-

AI助手支持GPT4.0