stivehu / yii2-jsrrd
jsrrd 的包装器
0.9
2015-11-24 10:46 UTC
Requires
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-09-07 10:24:32 UTC
README
========== jsrrd 的包装器
安装
安装此扩展的首选方式是通过 composer。
运行以下命令:
php composer.phar require --prefer-dist stivehu/yii2-jsrrd "*"
或者
"stivehu/yii2-jsrrd": "*"
将以下内容添加到您的 composer.json 文件的 require 部分。
使用方法
扩展安装完成后,只需在您的代码中使用它即可
<?= stivehu\widgets\jsrrd::widget(); ?>``` You must create a draw() function. Example: <script> function draw(){ var ds_graph_opts={'Oscilator':{ color: "#ff8000", lines: { show: true, fill: true, fillColor:"#ffff80"} }} var graph_opts1={legend: { noColumns:4}, yaxis:{max:250,min:-200}}; var rrdflot_defaults1={graph_only:true,use_checked_DSs:true,checked_DSs:['SignChanger'],use_rra:true,rra:1} // the rrdFlotAsync object creates and handles the graph var f1=new rrdFlotAsync("mygraph1","example3.rrd",null,graph_opts1,ds_graph_opts,rrdflot_defaults1); var graph_opts2={legend: { noColumns:4}, yaxis:{min:100},tooltipOpts:{content:"MyValue: %y.3"}}; var rrdflot_defaults2={graph_only:true,use_checked_DSs:true,checked_DSs:['Oscilator'],use_rra:true,rra:0} // the rrdFlotAsync object creates and handles the graph var f2=new rrdFlotAsync("mygraph2","example3.rrd",null,graph_opts2,ds_graph_opts,rrdflot_defaults2); } </script> <table width="100%"> <tr><td width="50%"> <div id="mygraph1"></div> </td> <td> <div id="mygraph2"></div> </td></tr> </table>