Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
stivehu committed Nov 24, 2015
1 parent 7808018 commit 2bfdda5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,35 @@ Once the extension is installed, simply use it in your code by :

```php
<?= 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>

0 comments on commit 2bfdda5

Please sign in to comment.