$.ajax({
type: 'get',
url: 'index.php?route=extension/dashboard/chart/chart&token=<?php echo $token; ?>&range=' + $(this).attr('href'),
dataType: 'json',
success: function (json) {
if (typeof json['order'] == 'undefined') {
return false;
}
if (typeof json['amazon_order'] == 'undefined') {
return false;
}
var series = [json['amazon_order'], json['order'], json['customer']];
var option = {
shadowSize: 0,
colors: ['#FFA600', '#5D4D80', '#1065D2'],
series: {
bars: {
show: true,
barWidth: 1,
align: "left"
}
},
grid: {
backgroundColor: '#FFFFFF',
hoverable: true
},
xaxis: {
show: true,
ticks: json['xaxis']
}
};
$.plot('#chart-orders', series, option);
},
error: function (xhr, ajaxOptions, thrownError) {
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
});