“source”:
“来源”:
The second parameter specifies the user-friendly slug of the chart snippet as the source of script and data for the chart.
第二个参数指定图表片段的用户友好段,作为图表脚本和数据的来源。 p>
li>
“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')”
.
p>
li>
“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:
这是每个库的选项列表: p>
li>
- HighCharts.js: more, 3d, exporting
- HighCharts.js:更多,3d,导出 li>
- D3.js : pie, nvd3
- D3.js:饼图,nvd3 li>
- Chart.js : bundle
- Chart.js:捆绑包 li>
- Flot Charts : colorhelpers, canvas, categories, crosshair, errorbars, fillbetween, image, navigate, pie, resize, selection, stack, symbol, threshold, time
- 图表:色彩帮助器,画布,类别,十字线,错误栏,填充,图像,导航,饼图,调整大小,选择,堆栈,符号,阈值,时间 li>
ul>
How Charting libraries are used?
如何使用图表库? h4>
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.
而且,为了更快地加载页面,该库将被加载到页脚中。 p>
You can also use a built-in PHP function to invoke the chart anywhere in your template:
您还可以使用内置的PHP函数在模板中的任意位置调用图表: p>
<?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);
?>
?> p>
As always, there are exceptions:
和往常一样,有例外: p>
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库的链接包含在脚本的顶部,并保存在图表摘要中。 p>
How To use this plugin:
如何使用此插件: h4>
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.
只要确保在每个页面中仅包含其中一个库即可。 p>
li>
Every chart has two major parts: first a container, specified by a
or
-EOF-
AI助手支持GPT4.0