程序员人生 网站导航

自定义highchart tooltip

栏目:htmlcss时间:2015-03-20 09:18:47

贴1段自定义highchart tooltip的代码

实线了垮series的计算温柔序切换

formatter: function () { // var str = getTooltip(this); var str = '<b>' + Highcharts.dateFormat(config_timelabelformats.day, this.x) + '</b>'; var ele = null; $.each(this.points, function () { if(this.series.name == highstock_local()['electricity']){ ele = this; }else if(this.series.name == highstock_local()['net_income']){ if(ele == null){ str += '<br/>' + this.series.name + ":" + this.y; }else{ if(ele.series.visible == true && this.series.visible == true){ str += '<br/>' + highstock_local()['payout'] + ":" + (this.y + ele.y); str += '<br/>' + highstock_local()['electricity'] + ":" + (ele.y); }else{ str += '<br/>' + highstock_local()['electricity'] + ":" + (ele.y); } } }else{ str += '<br/>' + this.series.name + ': ' + this.y; } }); return str; }
------分隔线----------------------------
------分隔线----------------------------

最新技术推荐