首页 > 其他分享 >Echart图表 之 tooltip提示框组件配置项大全

Echart图表 之 tooltip提示框组件配置项大全

时间:2023-08-16 20:23:13浏览次数:38  
标签:文字 颜色 Echart color 浮层 tooltip 阴影 提示框

axisPointer:坐标轴指示器配置项
label:坐标轴指示器的文本标签
lineStyle:axisPointer.type为line时有效
shadowStyle:axisPointer.type为shadow时有效
crossStyle:axisPointer.type为cross时有效。
textStyle:提示框浮层的文本样式
其中也会含有很多属性,具体使用请参考一下内容

  1 tooltip: {
  2 show: true, //是否显示提示框组件
  3 trigger: 'item', //触发类型,属性值:item数据项触发/axis坐标轴触发/none不触发
  4 axisPointer: {
  5 type: 'line', //指示器类型,属性值:line直线/shadow阴影/none/cross十字准星
  6 axis: 'auto', //指示器坐标轴,属性值:x/y/radius/angle
  7 snap: true, //坐标轴指示器是否自动吸附到点上。默认自动判断,布尔值
  8 z: 0, //坐标轴指示器z值,控制图形的前后顺序,属性值:number
  9 label: {
 10 show: false, //是否显示文本标签
 11 precision: 'auto', //文本标签中数值小数点精度。默认根据当前轴的值自动判断
 12 formatter: {}, //文本标签文字格式化器
 13 margin: 3, //label距离轴的距离
 14 color: '#fff', /颜色,文章链接如下 Echart图表之颜色color配置项大全/
 15 fontStyle: '',
 16 fontWeight: '',
 17 fontFamily: '',
 18 fontSize: 12,
 19 lineHeigh: 20,
 20 width: 20,
 21 height: 100,
 22 textBorderColor: '', //文字本身描边颜色
 23 textBorderWidth: , //文字本身描边宽度
 24 textBorderType: 'solid', //文字本身描边类型,属性值:solid/dashed/dotted/number/array
 25 textBorderDashOffset: 0, //虚线偏移量,搭配textBorderType指定dashed/array实现虚线效果
 26 textShadowColor: 'transparent', //文字本身阴影颜色
 27 textShadowBlur: 0, //文字本身的阴影长度
 28 textShadowOffsetX: 0, //文字本身的阴影 X 偏移
 29 textShadowOffsetY: 0, //文字本身的阴影 Y 偏移
 30 overflow: 'none', //文字超出宽度是否截断或换行,配置width时有效,truncate/break/breakAll
 31 ellipsis: '', //在overflow配置为'truncate'的时候,可以通过该属性配置末尾显示的文本
 32 padding: 0,
 33 backgroundColor: 'auto', //背景颜色,默认是和axis.axisLine.lineStyle.color 相同
 34 borderColor: '', //文本标签的边框颜色
 35 borderWidth: 0, //文本标签的边框宽度
 36 shadowBlur: 3, //图形阴影模糊大小,配合shadowColor,shadowOffsetX,shadowOffsetY设置阴影效果
 37 shadowColor: #aaa, //阴影颜色,支持的格式同color
 38 shadowOffsetX: 0, //阴影水平方向上的偏移距离
 39 shadowOffsetY: 0 //阴影垂直方向上的偏移距离
 40 },
 41 lineStyle: {
 42 color: #555, /颜色,文章链接如下 Echart图表之颜色color配置项大全/
 43 width: 1, //线宽
 44 type: solid, //线的类型,属性值:solid/dashed/dotted/number/array
 45 dashOffset: 0, //虚线偏移量,搭配type指定dashed/array实现虚线效果
 46 cap: 'butt', //线段末端的绘制,butt方形/round圆形/square也是方形效果与butt不同
 47 join: 'bevel', //设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性,bevel默认/round/miter
 48 miterLimit: 10, //设置斜接面限制比例,只有当join为miter才有效,属性值:10默认值/number
 49 shadowBlur: 10, //阴影模糊大小,该属性配合shadowColor/shadowOffsetX/shadowOffsetY一起设置图形的阴影效果
 50 shadowColor: '', //阴影颜色,支持的格式同color
 51 shadowOffsetX: 0, //阴影水平方向上的偏移距离
 52 shadowOffsetY: 0, //阴影垂直方向上的偏移距离
 53 opacity: 1 //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形
 54 },
 55 shadowStyle: {
 56 color: '#fff', /颜色,文章链接如下 Echart图表之颜色color配置项大全/
 57 shadowBlur: 10,
 58 shadowColor: '',
 59 shadowOffsetX: 0,
 60 shadowOffsetY: 0,
 61 opacity: 1
 62 },
 63 crossStyle: {
 64 color: '#fff', /颜色,文章链接如下 Echart图表之颜色color配置项大全/
 65 shadowBlur: 10,
 66 shadowColor: '',
 67 shadowOffsetX: 0,
 68 shadowOffsetY: 0,
 69 opacity: 1
 70 },
 71 animation: true, //是否开启动画
 72 animationThreshold: 2000, //是否开启动画的阈值
 73 animationDuration: 1000, //初始动画的时长,支持回调函数
 74 animationEasing: 'cubicOut', //初始动画的缓动效果
 75 animationDelay: 0, //初始动画的延迟,支持回调函数
 76 animationDurationUpdate: 200, //数据更新动画的时长,支持回调函数
 77 animationEasingUpdate: exponentialOut, //数据更新动画的缓动效果
 78 },
 79 showContent: true, //是否显示提示框浮层,默认显示
 80 alwaysShowContent: false, //是否永远显示提示框内容
 81 triggerOn: 'mousemove|click', //提示框触发条件,mousemove/click/mousemove|click/none。none时可通过action.tooltip.showTip和action.tooltip.hideTip来手动触发和隐藏。也可通过axisPointer.handle来触发或隐藏
 82 showDelay: 0, //浮层显示的延迟,默认0ms
 83 hideDelay: 100, //浮层隐藏的延迟
 84 enterable: false, //鼠标是否可进入提示框浮层中,默认为false
 85 renderMode: 'html', //浮层的渲染模式,html默认/richText富文本形式
 86 confine: false, //是否将 tooltip 框限制在图表的区域内
 87 appendToBody: false, //是否将组件DOM节点添加为HTML的<body>子节点。只有当renderMode为html有意义
 88 className: 'echarts-tooltip echarts-tooltip-dark', //指定tooltip的DOM节点CSS类,只在html模式下生效
 89 transitionDuration: 0.4, //提示框浮层的移动动画过渡时间,单位是s
 90 position: [], //提示框浮层的位置
 91 formatter: ()=>{}, /提示框浮层内容格式器,用这个可以修改提示框默认内容/
 92 valueFormatter: (value: number | string) => string, //数值显示部分的格式化回调函数
 93 backgroundColor: '', //背景颜色,格式同color
 94 borderColor: '', //提示框浮层边框颜色,格式同color
 95 borderWidth: 0, //提示框浮层的边框宽
 96 padding: 5,
 97 textStyle: {
 98 color: '#fff', /颜色,文章链接如下 Echart图表之颜色color配置项大全/
 99 fontStyle: '',
100 fontWeight: '',
101 fontFamily: '',
102 fontSize: 14,
103 lineHeight : 20,
104 width: 220,
105 height: 20,
106 textBorderColor: '', //文字本身的描边颜色
107 textBorderWidth: '', //文字本身的描边宽度
108 textBorderType: 'solid', //文字本身描边类型,属性值:solid/dashed/dotted/number/array
109 textBorderDashOffset: 0, //虚线偏移量,可搭配textBorderType指定dashed/array实现灵活的虚线效果
110 textShadowColor: 'transparent', //文字本身阴影颜色
111 textShadowBlur: 0, //文字本身阴影长度
112 textShadowOffsetX: 0, //文字本身阴影 X 偏移
113 textShadowOffsetY: 0, //文字本身阴影 Y 偏移
114 overflow: 'none', //文字超出宽度是否截断或者换行,配置width时有效,属性值:truncate/break/breakAll
115 ellipsis: '', //在overflow配置为'truncate'的时,该属性配置末尾显示文本
116 rich: {}, //自定义富文本样式
117 },
118 extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);', //额外附加到浮层的 css 样式
119 order: 'seriesAsc' //多系列提示框浮层排列顺序,seriesAsc默认/seriesDesc/valueAsc/valueDesc
120 }

 

标签:文字,颜色,Echart,color,浮层,tooltip,阴影,提示框
From: https://www.cnblogs.com/gluncle/p/17636091.html

相关文章

  • echarts 学习1
    构建代码varecharts=require('echarts');//基于准备好的dom,初始化echarts实例varmyChart=echarts.init(document.getElementById('main'));//绘制图表myChart.setOption({title:{text:'ECharts入门示例'},tooltip:{},......
  • 微信小程序解决ec-canvas偶现echarts未显示问题
    使用ec-canvas展示echarts图表,但是在实际操作中,偶现echarts空白问题。解决<viewclass="echarts-con"><ec-canvasid="pie-echarts"canvas-id="pie-echarts":ec="ec"@inited="getData"/></view>constgetData=as......
  • echarts使用个性化百度地图(bmap)加载出现空白问题
     原因分析主要因为百度地图v2.0添加了个性化样式设置(给option.bmap中添加了styleJson配置)造成的,如果需要解决就要用v3.0,设置个性化的方式也不一样,引入的百度地图版本也要改成v3.0解决方式获取styleId过程:如果要是用styleid就必须要和引入的key是同一个账号才可以进入百度地图......
  • ECharts实现两条曲线数据比较,数据高出区域高亮显示
    显示效果: 代码实现:<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width,initial-scale=1.0"/><title>EChar......
  • vscode中使用echarts(横向柱形图)
    第一步:引入echartsimport*asechartsfrom"echarts";第二步:准备一个放入echarts的盒子<template><div><divclass="bar"></div></div></template>第三步:绘制图表drawBar(){letmyChart=echarts.init(d......
  • echart 实现添加警戒线
    代码:option={xAxis:{type:'category',data:['Mon','Tue','Wed','Thu','Fri','Sat','Sun']},yAxis:{type:'value',},series:[......
  • WPF 密码提示框
    首先展示效果 如图密码提示框,可通过小眼睛进行显示和隐藏密码1、自定义控件publicclassTitlePasswordBox:TextBox{///<summary>///密码提示框提示语///</summary>publicstringTitle{get{return(strin......
  • 数据格式的处理 echarts数据改为 Table表格格式的数据
      前景后端返回的echarts展示数据格式,既要展示echarts又要展示table表格,echarts的数据格式为下面{xData:['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],yData1:[10,52,200,334,390,330,220],yData2:......
  • echarts多次setOption没有覆盖上一条数据 和 echarts的站位问题
    1、问题现象:echarts第一次获取的数据展示后第二次再次获取会覆盖不了展示的依然是上次的数据解决办法:chart.clear()   2、问题现象:echarts的占位没有数据的话是只展示x轴和y轴解决办法:利用title的副标题subtext,默认为“暂无......
  • 使用echarts画流程图-2
    效果图代码vardata=[{name:'数据中心人员专题库',tooltip:{formatter:'{b}:19999<br/>'},value:[10,0],symbol:'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAAyCAYAAAAA9rgCAAA......