Toggle navigation
饼图空白
By
1095193301
2017-07-05 02:19:16
脚本
16
21
作品使用的第三方脚本
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
我是在angular.js中使用echars图标的饼图,首次加载饼图出现, 饼图在参数页面内! 当点击曲线,温度,状态等页面后,再点击参数页面(饼图在参数页面)后,饼图区域显示空白!!F5刷新后饼图会再次出现!~!!请高手帮忙! 下面是我代码!只是正常的饼图代码。 var myChart = echarts.init(document.getElementById('parameter_main')); // 指定图表的配置项和数据 var labelTop = { normal : { label : { show : true, position : 'center', formatter : '{b}', textStyle: { baseline : 'bottom' } }, labelLine : { show : false } }, }; var labelFromatter = { normal : { label : { formatter : function (params){ // console.log(params) if (params.seriesIndex == 0){ if(params.value > 100 || params.value < 0){ return 100; } else{ return (100-params.value).toFixed(2); } } else if(params.seriesIndex == 1){ //console.log(params.seriesIndex,'==1') if(params.value > 20 || params.value < 0){ return 20; } else{ return 20-params.value; } } else if(params.seriesIndex == 2){ if(params.value > 10 || params.value < 0){ return 10; } else{ return 10-params.value; } } else if(params.seriesIndex == 3){ if(params.value > 400){ return 400; } else{ return 400-params.value; } } }, textStyle: { baseline : 'top' } } }, } var labelBottom = { normal : { color: '#ccc', label : { show : true, position : 'center' }, labelLine : { show : false } }, emphasis: { color: 'rgba(0,0,0,0)' } }; var radius = [30, 40]; options = { legend: { data:[] }, series : [ { type : 'pie', center : ['25%', '25%'], radius : radius, x: '0%', // for funnel itemStyle : labelFromatter, data : [ {name:'other', value: 100-char_xishu, itemStyle : labelBottom}, {name:'挤压系数',value:char_xishu,itemStyle : labelTop} ] }, { type : 'pie', center : ['75%', '25%'], radius : radius, x:'20%', // for funnel itemStyle : labelFromatter, data : [ {name:'other', value:20-char_sudu, itemStyle : labelBottom}, {name:'挤压速度', value:char_sudu,itemStyle : labelTop} ] }, { type : 'pie', center : ['25%', '75%'], radius : radius, x:'40%', // for funnel itemStyle : labelFromatter, data : [ {name:'other', value:10-char_yali, itemStyle : labelBottom}, {name:'填充压力', value:char_yali,itemStyle : labelTop} ] }, { type : 'pie', center : ['75%', '75%'], radius : radius, x:'60%', // for funnel itemStyle : labelFromatter, data : [ {name:'other', value:400-char_houdu, itemStyle : labelBottom}, {name:'压余厚度', value:char_houdu,itemStyle : labelTop} ] } ]}; // 使用刚指定的配置项和数据显示图表。 //console.log(option,char_xishu,char_sudu,'option') //myChart.clear(); // myChart.refresh(); myChart.setOption(options);