I need to know how I can easily add another series to an existing plot using Flot. Here is how I currently plot a single series:
function sendQuery(){
var host_name = $('#hostNameInput').val();
var objectName = $('#objectNameSelect option:selected').text();
var instanceName = $('#instanceNameSelect option:selected').text();
var counterName = $('#counterNameSelect option:selected').text();
$.ajax({
beforeSend: function(){$('#loading').show();},
type: "GET",
url: "http://okcmondev102/cgi-bin/itor_PerfQuery.pl?machine="+host_name+"&objectName="+objectName+"&instanceName="+instanceName+"&counterName="+counterName,
dataType: "XML",
success: function(xml){
var results = new Array();
var counter = 0;
var $xml = $.xmlDOM(xml);
$xml.find('DATA').each(function(){
results[counter] = new Array(2);
results[counter][0] = $(this).find('TIMESTAMP').text();
results[counter][1] = $(this).find('VALUE').text();
counter++;
});
plot = $.plot($("#resultsArea"),[ { data: results, label: host_name} ],
{
series: {
lines: { show: true }
},
xaxis: {
mode: "time",
timeformat: "%m/%d/%y %h:%S%P"
},
colors: ["#000099"],
crosshair: { mode: "x" },
grid: { hoverable: true, clickable: true }
});