当前位置: 首页 > news >正文

纺织网站建设方案网站快速网站推广

纺织网站建设方案,网站快速网站推广,做设计素材在哪个网站,酒店网站建设方案ppt需求#xff1a;柱状图每根柱子都添加单独的警戒值#xff08;黄色线部分#xff09;#xff0c;效果图如下#xff1a; 实现方式我这有两种方案#xff0c;如下介绍。 方案1#xff1a;使用echarts的标线markLine实现#xff08;ps#xff1a;此种方案有弊端#x…需求柱状图每根柱子都添加单独的警戒值黄色线部分效果图如下 实现方式我这有两种方案如下介绍。 方案1使用echarts的标线markLine实现ps此种方案有弊端需要一一设置每个柱子的标线起始点不好控制不太建议使用 代码如下 body!-- 为 ECharts 准备一个定义了宽高的 DOM --div idmain stylewidth: 600px;height:400px;/divscript typetext/javascript// 基于准备好的dom初始化echarts实例var myChart echarts.init(document.getElementById(main));// 警戒线let markLines []let markLineValue [10,20,30,40,30] //警戒线值let markLineItem [//第一条警戒线{yAxis: markLineValue[0],x: 60, //设置警戒线的起点偏移量lineStyle: { type: solid, color: yellow, width: 3 },label: { show: true, color: yellow, position: insideMiddleBottom, formatter: markLineValue[0] db },},{position: middle,yAxis: markLineValue[0],x: 110, //设置警戒线的终点偏移量lineStyle: { type: solid, color: yellow, width: 3 },label: { show: true, position: insideMiddleBottom },}]markLines.push(markLineItem);//设置每一条标线的起始偏移量根据实际情况自行改之for (let i 1; i markLineValue.length; i) {let item JSON.parse(JSON.stringify(markLines[i-1]))let xStart item[0].xlet xEnd item[1].xitem[0].x xStart 115item[0].yAxis markLineValue[i]item[0].label.formatter markLineValue[i] dbitem[1].x xEnd 115item[1].yAxis markLineValue[i]markLines.push(item)}var option {title: {text: ECharts 入门示例},tooltip: {show: true,trigger: axis},legend: {data: [销量]},xAxis: {data: [衬衫11111111111111111, 羊毛衫, 雪纺衫, 裤子, 高跟鞋],axisLabel: {// 文字省略formatter: function (value) {if (value.length 3) {return ${value.slice(0, 3)}...}return value}}},yAxis: {splitLine: { show: false }},grid: {containLabel: true,top: 30,left: 10,right: 10,bottom: 8},series: [{name: 销量,type: bar,data: [5, 20, 36, 10, 10],barWidth: 50px, // 柱图宽度itemStyle: {normal: {label: {formatter: {c} db,show: true,position: top,textStyle: {color: blue}}}},//设置柱状图背景showBackground: true,backgroundStyle: {color: rgba(180, 180, 180, 0.2)},markLine: {symbol: none, //去掉警戒线最后面的箭头data:markLines}}]};// 使用刚指定的配置项和数据显示图表。myChart.setOption(option);/script /body方案2使用echarts的自定义图形custom实现此方案较方案一更实用 代码如下 body!-- 为 ECharts 准备一个定义了宽高的 DOM --div idmain stylewidth: 600px;height:400px;/divscript typetext/javascript// 基于准备好的dom初始化echarts实例var myChart echarts.init(document.getElementById(main));let markLineValue [10,20,30,40,30] //警戒线值var option {title: {text: ECharts 入门示例},tooltip: {show: true,trigger: axis},legend: {data: [销量]},xAxis: {data: [衬衫11111111111111111, 羊毛衫, 雪纺衫, 裤子, 高跟鞋],axisLabel: {// 文字省略formatter: function (value) {if (value.length 3) {return ${value.slice(0, 3)}...}return value}}},yAxis: {splitLine: { show: false }},grid: {containLabel: true,top: 30,left: 10,right: 10,bottom: 8},series: [{name: 销量,type: bar,data: [5, 20, 36, 10, 10],barWidth: 50px, // 柱图宽度itemStyle: {normal: {label: {formatter: {c} db,show: true,position: top,textStyle: {color: blue}}}},//设置柱状图背景showBackground: true,backgroundStyle: {color: rgba(180, 180, 180, 0.2)}},{type: custom,// 图形渲染逻辑函数renderItem: function renderItem(param, api) {//获取每根柱子中点的xy坐标var point api.coord([api.value(0), api.value(1)]);return {type: line,transition: [shape],shape: {x1: point[0] - 25, //每根柱子的起点x轴坐标我这的柱子宽度为50px起点就为point[0]-50/2x2: point[0] 25, //每根柱子的终点x轴坐标y1: point[1],y2: point[1]},style: api.style({stroke: api.visual(color),lineWidth: 3,})};},itemStyle: {borderType: soild, //可以控制警示线的样式normal: {label: {formatter: {c} db,show: true,position: bottom,textStyle: {color: yellow}},color: yellow,}},z: 999, //控制图形前后顺序数值小会被数值大的覆盖data: markLineValue //警示线的数值}]};// 使用刚指定的配置项和数据显示图表。myChart.setOption(option);/script /body
http://www.hkea.cn/news/14446005/

相关文章:

  • 常州市建设局网站建网站logo怎么做
  • 深圳搭建网站公司wp网站如何做多级联动筛选框
  • 制作需要多少钱西安网站seo外包
  • 虚拟主机网站301跳转网站不收录原因
  • 网站制作商网站首页psd下载
  • 网站域名的根目录在哪里数据中心网站模板
  • 视频网站 建设 硬件建购物网站多少钱
  • 怎么制作网站生成图片鲜花网站建设规模设想
  • 那个外贸网站做的最好如何更快的学习.net网站开发
  • 网站建设 辉煌电商上海十大跨境电商排名
  • 温江区建设局网站怎么做网站平台
  • 网站前置审批项猪八戒网做网站怎么样
  • 用word文档做网站网站域名注册费用
  • 怎样做网站首页微信小程序网站建设推广
  • 哪个网站是专门做兼职的密云网站建设
  • 承德兴隆建设局网站宁波seo推荐推广平台
  • wap企业网站设计工作室韵味的名字
  • 网站开发东莞医院网站备案流程
  • 快三彩票网站开发网络营销属于哪个专业
  • wordpress回收站位置郑州建网站费用
  • 网站建设标语文案做网站网站
  • 网站设计与制作是做什么工作304hk 爱站网
  • 哈尔滨市建设网站wordpress博客如何防止另存为
  • 生成图片链接的网站无锡建站模板系统
  • 专业电商网站建设哪家好乐清英文网站建设
  • 售后服务网站长沙法律咨询网站设计开发
  • 郑州网站推广专员网站备案名称能重复吗
  • 新手建设什么网站好wordpress管理员账号
  • 珠海市网站建设分站怎么样网站配色与布局
  • 贺州招聘网站建设旅游网站设计风格