flot yaxis ragne
HTML
<script src="http://people.iola.dk/olau/flot/jquery.flot.js"></script>
<script src="http://jquery-json.googlecode.com/svn/trunk/src/jquery.json.min.js"></script>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="http://people.iola.dk/olau/flot/excanvas.min.js"></script><![endif]-->
<h1>Flot Examples</h1>
<div id="placeholder" style="width:600px;height:300px;"></div>
<button id="plot">plot</button>
JavaScript
$(function() {
var d1 = [];
for (var i = 0; i < 14; i += 0.5)
d1.push([i, Math.sin(i)]);
var data = [];
for (i = 0; i < 48; i++) {
data.push({
label: "d" + i,
data: $.map(d1, function(val) {
return [[val[0], val[1] + i + 1]]
})
});
}
$.plot($("#placeholder"), [d1], {
legend: {
position: "ne",
noColumns: 6
}
});
});
$("#plot").click(function() {
var d = [];
for (var i = 0; i < 100; i++) {
d.push([i,Math.random()]);
}
$.ajax({
url: "/echo/json/",
type: "POST",
data: {
json: $.toJSON({result: d})
},
dataType: "json"
})
.done(function(data){
$.plot($("#placeholder"), [data.result], {
legend: {
position: "nw",
noColumns: 6
}
});
})
});