python k线图 动态刷新不了_echarts图表动态刷新数据不能请空问题

//路径配置

require.config({

paths: {

echarts:'http://echarts.baidu.com/build/dist'}

});//使用

require(

['echarts','echarts/chart/line','echarts/chart/bar' //使用柱状图就加载bar模块,按需加载

],function(ec) {//基于准备好的dom,初始化echarts图表

var myChart = ec.init(document.getElementById('main'));var option ={

tooltip: {

show:true},

legend: {

data:['Bugs2']

},

toolbox: {

show :true,

feature : {

mark : {show:true},

dataView : {show:true, readOnly: false},

magicType : {show:true, type: ['line', 'bar']},

restore : {show:true},//saveAsImage : {show: true}

}

},

xAxis : [

{

type :'category',

data : []

}

],

yAxis : [

{

type :'value'}

],

series : [{name:'',type:'bar',data:[]}]

};//有bug,不能动弹刷新

$(function() {

$('tr td a').bind('click', function() {//alert($(this).closest('tr').find('td:eq(1)').text());

$.getJSON("/productdatas", {

product: $(this).closest('tr').find('td:eq(1)').text(),

},function(data) {//alert(data.date);

option.xAxis[0].data =data.date;

option.series[0].name =data.name;

option.series[0].data =data.data;

alert(option.series[0].data)

myChart.setOption(option);//myChart.setSeries(data.data);

});

});

});

}

);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值