基于highcharts 折线图

var chart = null;
// 获取 CSV 数据并初始化图表
var filename = getQueryString(“FileName”);
var url =“http://localhost/LogInfo/LogInfo/Index1?FileName=”+filename;
$.getJSON(url, function (csv) {
var dayArray = new Array();
var eachArray = new Array();
var num = new Array();
var textarray = new Array();
var text = new Array();
//var x_text = new Array();
var x_text;
for (var i = 0; i < csv.length; i++)
{
if (i == 0)
{
// x_text=({ categories: csv[0].x_text });
x_text = csv[0].x_text;
}
text.push({ name: csv[i].day, data: csv[i].eachday });
}
console.log(text);
console.log(x_text);
//动态数组拼接
chart = Highcharts.chart(‘chart_line’, {//容器id
series: text,
title: {
text: ‘hfs调用时间汇总折线图’
},
global: {
useUTC: false
},
xAxis: {
title: { text: ‘时间区间/秒’ },
categories: x_text,
// type: ‘datetime’
},
yAxis: { //y轴
title: { text: ‘hfs下载次数/个’ }, //标题
//lineWidth: 2 //基线宽度
},
});
});

你可能感兴趣的:(基于highcharts 折线图)