echarts icon indicating copy to clipboard operation
echarts copied to clipboard

echarts 图表显示数据不显示

Open mrpsweet opened this issue 9 years ago • 4 comments

One-line summary [问题简述]

echarts 下图表显示数据不显示 ,每次都要点击上方的刷新按钮才能把数据显示完全。

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: echarts2.0
  • Browser version [浏览器类型和版本]:chrome47
  • OS Version [操作系统类型和版本]:win10 专业版 64位

Expected behaviour [期望结果]

希望能解决此问题

ECharts option [ECharts配置项]

option = {
    legend: {
                            x: 'center',
                            y: 'center',
                            show: true,
                            data: [
                                'B1F变', 'B2F变', 'B3F变', '6F变', '20F变',
                                '35F变', '50F变', '66F变', '82F变', '99F变', '116F变', '柴发10kV'
                            ]
                        },
                        toolbox: {
                            show: true,
                            feature: {
                                dataView: {
                                    show: true,
                                    readOnly: false
                                },
                                magicType: {
                                    show: true,
                                    type: ['pie', 'funnel'],
                                    option: {
                                        funnel: {
                                            width: '20%',
                                            height: '30%',
                                            itemStyle: {
                                                normal: {
                                                    label: {
                                                        formatter: function (params) {
                                                            return 'other\n' + params.value + '%\n';
                                                        },
                                                        textStyle: {
                                                            baseline: 'middle'
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                restore: {
                                    show: true
                                },
                                saveAsImage: {
                                    show: true
                                }
                            }
                        },
                        series: [
                            {
                                type: 'pie',
                                center: ['10%', '30%'],
                                radius: [20, 35],
                                x: '0%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 46,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: 'B1F变',
                                        value: 54,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['26%', '30%'],
                                radius: [20, 35],
                                x: '20%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 56,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: 'B2F变',
                                        value: 44,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['42%', '30%'],
                                radius: [20, 35],
                                x: '40%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 65,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: 'B3F变',
                                        value: 35,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['58%', '30%'],
                                radius: [20, 35],
                                x: '60%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 70,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: '6F变',
                                        value: 30,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['74%', '30%'],
                                radius: [20, 35],
                                x: '80%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 73,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: '20F变',
                                        value: 27,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['90%', '30%'],
                                radius: [20, 35],
                                y: '55%', // for funnel
                                x: '0%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 78,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: '35F变',
                                        value: 22,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['10%', '82%'],
                                radius: [20, 35],
                                y: '55%', // for funnel
                                x: '20%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 78,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: '50F变',
                                        value: 22,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['26%', '82%'],
                                radius: [20, 35],
                                y: '55%', // for funnel
                                x: '40%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 78,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: '66F变',
                                        value: 22,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['42%', '82%'],
                                radius: [20, 35],
                                y: '55%', // for funnel
                                x: '60%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 83,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: '82F变',
                                        value: 17,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['58%', '82%'],
                                radius: [20, 35],
                                y: '55%', // for funnel
                                x: '80%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 89,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: '99F变',
                                        value: 11,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['74%', '82%'],
                                radius: [20, 35],
                                y: '55%', // for funnel
                                x: '60%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 83,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: '116F变',
                                        value: 17,
                                        itemStyle: labelTop
                                    }
                                ]
                            },
                            {
                                type: 'pie',
                                center: ['90%', '82%'],
                                radius: [20, 35],
                                y: '55%', // for funnel
                                x: '80%', // for funnel
                                itemStyle: labelFromatter,
                                data: [
                                    {
                                        name: 'other',
                                        value: 89,
                                        itemStyle: labelBottom
                                    },
                                    {
                                        name: '柴发10kV',
                                        value: 11,
                                        itemStyle: labelTop
                                    }
                                ]
                            }
                        ]
};

Other comments [其他信息]

https://github.com/mrpsweet/mrpsweet.github.io/blob/master/images/ECharts%20(1).png https://github.com/mrpsweet/mrpsweet.github.io/blob/master/images/ECharts%20(2).png 未显示 显示

mrpsweet avatar Jan 05 '17 09:01 mrpsweet

labelFromatter is not defined 麻烦把例子放到 http://gallery.echartsjs.com/editor.html 吧

Ovilia avatar Mar 29 '17 06:03 Ovilia

我已经从那家公司离职了,解决办法也找到了 so 这个issue 可以关闭了

mrpsweet avatar Apr 23 '17 11:04 mrpsweet

额

ppker avatar Apr 24 '17 01:04 ppker

我已经从那家公司离职了,解决办法也找到了 so 这个issue 可以关闭了

哈喽,能说一下你的解决办法么?

y925249766 avatar Aug 04 '20 03:08 y925249766