山东大学软件学院2018级暑期项目实训 第五周 第3次

一、echarts构建实体识别词云

1)在HTML中添加dom
2)

var myChart1 = echarts.init(document.getElementById('main1'))
            let colorList = [
                '#CF4645','#B580B2','#29008A','#146A90','#8956FF','#70C9A8',
                '#bfbfbf','#595959',
                '#40a9ff','#1890ff',
                '#ffd666','#ffc53d','#ffc53d','#ffc069','#ffa940','#fa8c16',
                '#eccbd9','#ffadad','#ff6392','#ffc09f','#ffcb77','#ffe066','#ffd53e','#ffda3d','#adf7b6','#a0e8af','#80ed99','#07beb8','#17c3b2','#48cae4','#97d2fb','#83bcff','#91e5f6','#9381ff']
            let colorListLen = colorList.length
            let fontSizeList = [
                12,12.5,13,13.5,14,14.5,
                15,15.5,16,16.5,17,17.5,
                18,18.5,19,19.5,20,20.5,
                21,22,23,
                24]
            let fontSizeListLen = fontSizeList.length
            let customLabel = {
                color: colorList[Math.floor(Math.random()*colorListLen)],
                fontSize: fontSizeList[Math.floor(Math.random()*fontSizeListLen)]
            }
            let bgColor = '#fffcf9'
            let canDraggable = false
            var option = {

                color: ['#37A2DA', '#32C5E9', '#67E0E3'],
                title: {
                    show: false,
                    text: '一天的时间流逝',
                    x: 'center',
                    y: 'bottom',
                    // 文字的颜色,默认 #333。
                    color: '#666',
                    fontSize: 24
                },
                toolbox: {
                    show: true,
                    feature: {
                        // dataView: {readOnly: false},
                        // magicType: {type: ['line', 'bar']},
                        restore: {},
                        // saveAsImage: {}
                    }
                },
                itemStyle: {
                    color: bgColor
                },
                series: [
                    {
                        type: 'graph',
                        layout: 'force',
                        force: {
                            repulsion: 20,
                            edgeLength: 10
                        },
                        roam: 'scale',
                        // symbol: '',
                        // symbolSize: 0,
                        label: {
                            show: true,
                            color: 'auto',
                            fontSize: 14
                        },
                        data: [

                        ]
                    }
                ]
            }
            myChart1.setOption(option)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值