<template>
    <div :id="'options-count'+id" style="width: 240px;height: 180px;display: inline-block;margin-left:30px;"></div>
</template>
<script>
    export default {
        data() {
            return {
                id:'',
                optionBar: undefined,
                option: {
                    title: {
                        text: '正确率统计',
                        textStyle: {
                            color: 'white'
                        },
                        right: '70',
                        top:'10'
                    },
                    tooltip: {
                        trigger: 'item',
                        formatter: '{b} : {c} ({d}%)'
                    },
                    series: [
                        {
                            type: 'pie',
                            radius: '65%',
                            center: ['50%', '60%'],
                            selectedMode: 'single',
                            label: {
                                show: false
                            },
                            data: [
                                {
                                    value: 535,
                                    itemStyle: {
                                        color: '#1cc0f3'
                                    },
                                    name:'正确'
                                },
                                {
                                    value: 510,
                                    name: '错误',
                                    itemStyle: {
                                        color: '#ed4014'
                                    },
                                }
                            ]
                        }
                    ]
                }
            }
        },
        created() {
            this.id = this.$jsFn.getBtwRandom(0,100000000)
        },
        mounted() {
            this.typeCountPie = this.$echarts.init(document.getElementById('options-count' + this.id))
            this.typeCountPie.setOption(this.option)
        }
    }
</script>
<style scoped lang="less">
    #options-count {
    }
</style>
<style>
</style>