Rank: Newbie
Groups: Registered
Joined: 8/7/2014(UTC) Posts: 7
Thanks: 1 times Was thanked: 0 time(s) in 0 post(s)
|
Screenshot of issue: Code: Code:
$.ajax({ url: 'http://XXXXXXXXXXXXXXXXX:8081/appServer/gbReader/Session/cpuinfo/<?php echo $hash;?>/', dataType: 'json', async: false, success: function(data) { window.numCores = data.numCores; genChart(); } });
function genChart() { $('#cpucchartdiv').jqChart({ title: { text: 'CPU Core Usage', font: '18px sans-serif' }, axes: [ { type: 'linear', location: 'bottom', zoomEnabled: true } ], border: { strokeStyle: '#6ba851' }, background: '#FFFFFF', tooltips: { type: 'shared' }, crosshairs: { enabled: true, hLine: false, vLine: { strokeStyle: '#cc0a0c' } }, series: [] }); setupChart(); }
function setupChart() { var y = 0; var series = $('#cpucchartdiv').jqChart('option', 'series'); while(y<window.numCores) { $.ajax({ url: 'http://XXXXXXXXXXXXX:8081/appServer/gbReader/Session/coresusage/<?php echo $hash;?>/'+y+'/', dataType: 'json', async: false, success: function(data2) { window["core"+y] = data2; var newSeries = { type: 'line', data: window["core"+y], xValuesField: { name: 'timestamp', type: 'numeric' }, yValuesField: { name: 'coreUsage', type: 'numeric' } } console.log(newSeries); series.push(newSeries); } }); y++; } $('#cpucchartdiv').jqChart('update');
}
Data Example: Code: [{"id":5419954,"coreNumber":0,"coreUsage":60.6383,"timestamp":2},{"id":5415915,"coreNumber":0,"coreUsage":42.22222,"timestamp":3},{"id":5423837,"coreNumber":0,"coreUsage":42.22222,"timestamp":4}]
I'm using the 30-day trial right now to see if I can replace amCharts with jqChart - and from everything I've seen, it looks like I can, except for this issue. Any help would be appreciated.
|