Echarts的scatter3D 各个属性具体含义详解备注

Echarts的scatter3D 各个属性具体含义详解备注

猿掌柜
2021-05-24 / 0 评论 / 24 阅读 / 推送成功! 🔋充电中 100%
<script type="text/javascript">
        //Income:Z轴;Life Expectancy:Y轴;Country:X轴
        //井深:Z轴;Y坐标:Y轴;X坐标:X轴
        var jsonData=[["井深","Y坐标","人口密度","X坐标","Year"],
                      [10,14,11,2014],
                      [11,25,22,2015],
                      [12,36,33,2016],
                      [13,47,40,2017]
                     ];
        var myChart = echarts.init(document.getElementById('main'));
        function setOption(datas,x_min,x_max,y_min,y_max,xuanzhuan){
            var myChart = echarts.init(document.getElementById('main'));
            option = {
                grid3D:  {
                    boxWidth:  60,                        //图件宽
                    boxHeight: 122,                        //图件高
                    boxDepth:  60,                        //图件长
                    height: '100%',                        //容器高
                    width: '100%',                        //容器宽
                    bottom: 'auto',                        //3D图与下容器的距离
                    top:'auto',                               //3D图与上容器的距离
                    axisLine:{
                        lineStyle:{
                            color:'yellow'                 //坐标轴轴线颜色
                        }
                    },
                    splitLine:{
                        lineStyle:{
                            color:'#222'                  //分割线颜色
                        }
                    },
                    axisPointer:{
                        lineStyle:{
                            color:'#efe'                 //鼠标滑过分割线颜色
                        }
                    },
                    environment: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                          offset: 0, color: '#00aaff'     // 天空颜色
                        }, {
                          offset: 0.7, color: '#998866' // 地面颜色
                        }, {
                          offset: 1, color: '#998866'     // 地面颜色
                        }], false),
                    postEffect:{
                        enable:false                    //开启特效
                    },
                    viewControl:{
                        projection: 'perspective',        //默认为透视投影'perspective',也支持设置为正交投影'orthographic'
                        autoRotate: true,                //自动旋转
                        autoRotateDirection: 'ccw',     //默认是 'cw' 从上往下看是顺时针 也可以取 'ccw'逆时针
                        autoRotateSpeed: 4,                //默认10 自转速度
                        autoRotateAfterStill: 5,        //默认3秒 鼠标静止操作后恢复自动旋转的时间间隔
                        damping: 0.8,                    //鼠标进行旋转,缩放等操作时的迟滞因子,在大于 0 的时候鼠标在停止操作后,视角仍会因为一定的惯性继续运动(旋转和缩放)
                        animation: true,                //是否开启动画
                        animationDurationUpdate: 1000,    //过渡动画的时长
                        animationEasingUpdate: 'cubicInOut' //过渡动画的缓动效果
                    },
                    postEffect:{
                        enable:false                    //是否开启后处理特效,默认关闭 不能开  浏览器会卡
                    }
                },
                xAxis3D: {
                    show: true,
                    name: '南北-X',
                    nameTextStyle:{
                        color: 'lime',
                        fontWeight: 'normal'
                    },
                    min:x_min,
                    max:x_max
                },
                yAxis3D: {
                    show: true,
                    name: '东西-Y',
                    nameTextStyle:{
                        color: 'lime',
                        fontWeight: 'normal'
                    },
                    min:y_min,
                    max:x_max
                },
                zAxis3D: {
                    show: true,
                    name: '井深-Z',
                    nameTextStyle:{
                        color: 'lime',
                        fontWeight: 'normal'
                    }
                },
                dataset: {
                    dimensions: [
                        '井深',
                        'Y坐标',
                        'X坐标',
                        {name: '井名', type: 'ordinal'}
                    ],
                    source: datas
                },
                series: [
                    {
                        type: 'scatter3D',                //3D类型
                        name: '测试',                    //名字
                        //coordinateSystem: 'grid3D',    //使用地球三维地理坐标系
                        //grid3DIndex: 0,                //坐标轴使用的 geo3D 组件的索引
                        symbol:'diamond',                //点形状 'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow', 'none'
                        symbolSize: 3.5,                  //点大小
                        itemStyle: {
                            color:'white',                   //点颜色
                            borderColor: 'green',          //点边框颜色
                            opacity: 1,                    //点的透明度 1不透明
                            borderWidth: 0.5               //图形描边宽度
                        },
                        label:{
                            show:false,                 //是否显示点上面的标签,默认false
                            distance: 15,                //标签与点的距离
                            position:'left',              //标签位置
                            textStyle:{
                                color:'black',             //文字颜色
                                borderWidth:0,          //标签上边框宽度
                                borderColor:'white',       //边框颜色
                                fontFamily:'宋体',        //标签字体
                                fontSize:14,            //字体大小
                                fontWeight:'normal'        //是否加粗 
                            }
                        },
                        emphasis:{
                            itemStyle:{
                                color:'green',            //鼠标移到点上的颜色变化
                                opacity:1,                //不透明度
                                borderWidth:0,            //图像描边宽度
                                borderColor:'#fff'         //图形描边颜色
                            },
                            label:{
                                show:true,                //鼠标移动到点上是否显示标签
                                distance: 15,            //标签与点的距离
                                position:'left',          //标签位置
                                textStyle:{
                                    color:'black',         //文字颜色
                                    borderWidth:0,      //标签上边框宽度
                                    borderColor:'white',//边框颜色
                                    fontFamily:'宋体',    //标签字体
                                    fontSize:14,        //字体大小
                                    fontWeight:'normal'    //是否加粗 
                                }
                            }
                        },
                        blendMode:'lighter',            //混合模式默认使用的'source-over'是通过 alpha 混合,而'lighter'是叠加模式,该模式可以让数据集中的区域因为叠加而产生高亮的效果。
                        silent:false,                    //图形是否不响应和触发鼠标事件,默认为 false,即响应和触发鼠标事件。
                        animation:true,                    //是否开启动画
                        animationDurationUpdate:500,    //过渡动画的时长
                        animationEasingUpdate:'cubicOut',//过渡动画的缓动效果
                        encode: {
                            x: 'X坐标',
                            y: 'Y坐标',
                            z: '井深',
                            tooltip: [0, 1, 2, 3, 4]
                        }
                    }
                ]
            };
            myChart.setOption(option);
        } 
    </script>
5

评论 (0)

OωO
  • 爱你
  • 爱心
  • 傲慢
  • 白眼
  • 棒棒糖
  • 爆筋
  • 抱拳
  • 鄙视
  • 闭嘴
  • 擦汗
  • 菜刀
  • 吃
  • 呲牙
  • 大兵
  • 大哭
  • 蛋
  • 得意
  • doge
  • 发呆
  • 发怒
  • 奋斗
  • 尴尬
  • 勾引
  • 鼓掌
  • 害羞
  • 憨笑
  • 好棒
  • 哈欠
  • 喝彩
  • 河蟹
  • 坏笑
  • 饥饿
  • 惊恐
  • 惊喜
  • 惊讶
  • 菊花
  • 可爱
  • 可怜
  • 抠鼻
  • 酷
  • 快哭了
  • 骷髅
  • 困
  • 篮球
  • 泪奔
  • 冷汗
  • 流汗
  • 流泪
  • 难过
  • OK
  • 喷血
  • 撇嘴
  • 啤酒
  • 强
  • 敲打
  • 亲亲
  • 糗大了
  • 拳头
  • 骚扰
  • 色
  • 胜利
  • 手枪
  • 衰
  • 睡
  • 调皮
  • 偷笑
  • 吐
  • 托腮
  • 委屈
  • 微笑
  • 握手
  • 我最美
  • 无奈
  • 吓
  • 小纠结
  • 笑哭
  • 小样儿
  • 斜眼笑
  • 西瓜
  • 嘘
  • 羊驼
  • 阴险
  • 疑问
  • 右哼哼
  • 幽灵
  • 晕
  • 再见
  • 眨眼睛
  • 折磨
  • 咒骂
  • 抓狂
  • 左哼哼
经典
颜文字
取消