echarts的x轴y轴的颜色改变
来源:互联网 发布:datediff mysql 编辑:程序博客网 时间:2024/06/06 17:28
在操作echarts时,需求要求echarts的xy轴的颜色要与图形的颜色一致。
图1:
图2:
解决方案:
代码展示:
var myChart1; $(function() { document.getElementById("begin1").flatpickr(); document.getElementById("end1").flatpickr(); myChart1 = echarts.init(document.getElementById('mychart1')); myChart1.showLoading({ text : "图表数据正在努力加载..." }); //投标人报名次数排前十的数据统计 var options1 = { title : { text : '投标人累计报名次数排名', x : 'center' }, //color: colorArr, tooltip : { trigger : 'axis', axisPointer : { // 坐标轴指示器,坐标轴触发有效 type : 'shadow' // 默认为直线,可选为:'line' | 'shadow' } }, toolbox: { show : true, x:'950',//下载的字体显示不全 feature : { //dataView : {show: false, readOnly: false}, magicType : {show: true, type: ['line', 'bar']}, //restore : {show: true}, saveAsImage : {show: true} } }, // legend: { // x: 'left', // data: ['招标代理名称'] // }, grid : { // left : '1%', // right : '10%', // bottom : '3%', // containLabel : true y2: 140 }, xAxis : { type : 'category', name : '投标人', data : [ '' ], axisLabel:{ interval:0,//横轴信息全部显示 rotate:-30,//-30度角倾斜显示 }, axisLine:{ lineStyle:{ color:'#0087ED', width:1,//这里是为了突出显示加上的 } } }, yAxis : { type : 'value', name : '单位: 次', splitLine: { lineStyle: { // 使用深浅的间隔色 color: ['#0087ED'] } }, nameTextStyle: { color: ['#0087ED'] }, axisLine:{ lineStyle:{ color:'#0087ED', width:1,//这里是为了突出显示加上的 } } }, series: [{ name : '投标人名称', type : 'bar', stack : '次数', label : { normal : { show : true, position: 'top' } }, data : [ '' ], color:['#0087ED'], itemStyle: { normal: { barBorderRadius: 5, } }, barWidth: 30, }] }; myChart1.setOption(options1); getChartData1(); }); function getChartData1() { //获得图表的options对象 var newOption1 = myChart1.getOption(); //参数 var startDate = $("#begin1").val(); var endDate = $("#end1").val(); var type = $("#jylx-type1").val(); if(type==null || type=="" || type=="undefine"){ type = "${type}"; } var centerCode = $("#jyzx-all1").val(); //投标人报名次数排前十的数据统计 $.ajax({ type : "post", async : false, //同步执行 url : "bidder!bmcsBar.do", data : { startDate : startDate, endDate : endDate, type:type, centerCode:centerCode }, dataType : "json", //返回数据形式为json success : function(data) { if (data) { newOption1.xAxis[0].data = data.category; newOption1.series[0].data = data.series; myChart1.hideLoading(); myChart1.setOption(newOption1); } }, error : function(errorMsg) { alert("图表请求数据失败啦!"); myChart1.hideLoading(); } }); } //根据查询条件加载柱图 function showChart1() { getChartData1(); } </script>
转载地址:http://blog.csdn.net/wu920604/article/details/53422960
阅读全文
0 0
- echarts的x轴y轴的颜色改变
- echarts的x轴y轴的颜色改变
- ECharts | 改变 yAxis y轴的刻度
- Echarts学习记录——如何修改x轴和y轴的颜色
- echarts中y轴的自适应
- echarts 隐藏x轴 y轴 网格线
- echarts柱状图的X轴Y轴加单位的写法
- highcharts图表 去掉highcharts的logo 改变y轴的刻度 改变背景颜色 去掉图例
- echarts-设置折线样式和X轴和Y轴的分割线样式
- echarts-设置折线样式和X轴和Y轴的分割线样式
- echarts-设置折线样式和X轴和Y轴的分割线样式
- js 获取echarts点击点的X轴和Y轴值
- echarts改变柱状图每个柱子的颜色
- ECharts颜色渐变、Y轴文字左对齐
- VTK中改变默认的vtkAxesActor坐标轴上X,Y,Z的字体颜色,从白色改为其他颜色
- ECharts Y 轴 倒置
- echarts y 轴百分比
- Echarts--单个Y轴
- iOS页面消息角标展示数字
- 知识付费市场巨大,拿什么内容付费工具去实现知识变现?
- PULPino在zedboard上的下载、测试
- Ecplise安装FindBugs插件
- 代码三神器?
- echarts的x轴y轴的颜色改变
- python3机器学习——sklearn0.19.1版本——数据处理(二)(多项式、pipeline、分类模型评价标准)
- WebApi 的Action跳不进去
- 基于cyptopp库的rsa加解密详解
- 矩阵中的路径
- 10.2 数字与静态
- Java中抽象类和接口的配合使用
- angular @input @output
- 新建MAVEN项目--pom.xml报错