Sunday, 15 April 2012

javascript - use getJSON to getData From WebMethod Highcharts Live Data -



javascript - use getJSON to getData From WebMethod Highcharts Live Data -

i ve graph below insert info webmethod (webmethod in webservice):

highcharts.setoptions({ global: { useutc: false } }); chart3 = new highcharts.chart({ credits: { enabled: false }, chart: { renderto: 'container3', type: 'spline', animation: highcharts.svg, // ne marche pas dans les ie anciens marginright: 10, events: { load: function() { // maj du chart chaque seconde var series = this.series[0]; setinterval(function() { var x = (new date()).gettime(), // temps y = math.random(); series.addpoint([x, y], true, true); }, 1000); } } }, title: { text: 'test' }, xaxis: { type: 'datetime', tickpixelinterval: 150 }, yaxis: { title: { text: 'value' }, plotlines: [{ value: 0, width: 1, color: '#808080' }] }, tooltip: { formatter: function() { homecoming '<b>'+ this.series.name +'</b><br/>'+ highcharts.dateformat('%y-%m-%d %h:%m:%s', this.x) +'<br/>'+ highcharts.numberformat(this.y, 2); } }, legend: { enabled: false }, exporting: { enabled: false }, series: [{ name: 'random data', data: (function() { // generation de valeurs aléatoires var info = [], time = (new date()).gettime(), i; function onsucess(result) { alert(result); } (i = -19; <= 0; i++) { data.push({ x: time + * 1000, y: math.random() }); } homecoming data; })() }] });

in setinterval part, d value webservice webmethod , set in y, :

webservice:[webmethod]

public int getint() { val2 = rand.next(1, 100); homecoming val2; }

apparently need utilize getjson... dont know how.... help me giving illustration please ?

javascript asp.net web-services highcharts getjson

No comments:

Post a Comment