我创建了一个高图表和我从csv文件中获取的数据。图表运行良好并且绘图很好。但是我的问题是当页面刷新时没有从中取出最新值csv文件。它仍然显示旧的图表。当我关闭浏览器并重新打开图表工作正常。请帮助我如何重置/重绘更新的值从csv 下面是我的代码。此问题IE不能在Firefoxhighcharts当页面刷新时不刷新图表
变种选项= { 图表:{ renderTo: '容器', defaultSeriesType: '行', marginRight:130, marginBottom:25 }, 标题:{ 文本: '支持趋势P1,P2 & P3' }, XAXIS:{ 类:[] },
yAxis: { showLastLabel:true, tickInterval:5, title: { text: "" } }, series: [] }; $.get('../data/trending.txt', function(data) { // Split the lines var lines = data.split(';'); $.each(lines, function(lineNo, line) { var items = line.split(','); // header line containes categories if (lineNo == 0) { $.each(items, function(itemNo, item) { if (itemNo > 0) options.xAxis.categories.push(item); }); } // the rest of the lines contain data with their name in the first position else { var series = { data: [] }; $.each(items, function(itemNo, item) { if (itemNo == 0) { series.name = item; } else { series.data.push(parseFloat(item)); } }); options.series.push(series); } }); var chart = new Highcharts.Chart(options); }); });
块引用
No code to see here? – SteveP 2013-03-24 13:14:10
我的代码:HTTP://jsfiddle.net/r9Afj/4/embedded/result/ – arun 2013-03-24 15:08:49
任何人知道答案 – arun 2013-03-24 16:52:17