Prefaceecharts is my most commonly used charting tool, and it also has a very complete ecosystem and content, which is enough for our daily use. I was recently working on a big data platform page and needed to use a lot of charts, so I used echarts. During the use process, I also encountered some difficult problems or some properties hidden deep in the configuration manual. I will record them today. How to use1. Cancel the grid of the chart and change the color of the grid // Control whether the grid line is displayed splitLine: { show: false, //Whether the grid lines are displayed//Change style lineStyle: { color: '#ccc' // Change the grid line color} }, 2. Change the style of the coordinate axis xAxis: [ { type: 'category', boundaryGap: false, data: ['January', 'February', 'March', 'April', 'May', 'June'], axisLine:{ lineStyle:{color:"#ccc"} }, axisTick: { show: false // remove the scale}, axisLabel:{//Modify font styleshow: true,//Show and hidetextStyle:{color:"#ccc"} }, // Control whether the grid line is displayed splitLine: { show: false, //Whether the grid lines are displayed//Change style lineStyle: { color: '#ccc' // Change the grid line color} }, } ], yAxis: [ { type: 'value', name: '(times)', axisLine:{ lineStyle:{color:"#ccc",fontSize:'16'} }, axisTick: { show: false // remove the scale}, } ], 3. Some style modifications or configurations of the donut chart //Modify the style of the text in the center of the circle title: { text: value.value+'times', subtext: value.name, x: 'center', y: 'center', itemGap: 0, textStyle: { fontSize: 26, fontWeight: 'bold', color: 'rgb(0,237,255)' }, subtextStyle: { fontSize: 16, fontWeight: 'bold', color: '#fff' }, }, //Clear the floating effect of the circle when the mouse moves in series: [ { hoverAnimation:false, //Add this attribute} ] 4. Switch between multiple charts and clear the last loaded data Add true to setOption option && myChart.setOption(option,true); 5. Use of gradient colors in charts echarts.graphic.LinearGradient series: [ { type: 'pie', center: ['50%', '49%'], radius: ['45%', '73%'], // minAngle: 0, startAngle: 0, // gradient angle avoidLabelOverlap: true, //Whether to enable preventing label overlap emphasis: { label: { show: true, position: 'center' } }, data: seriesData, itemStyle: { emphasis: shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)', label: { show: true, } }, normal: { color: function (params) { //Color gradient var colorList = [ { c1: '#3288FC', c2: '#36B4FD' }, { c1: '#CBA0FF', c2: '#598EFE' }, ] return new echarts.graphic.LinearGradient(1, 0, 0, 0, [{ //The first four parameters of the color gradient function represent the four positions, left, bottom, right, and top, respectively. offset: 0, color: colorList[params.dataIndex].c1 }, { offset: 1, color: colorList[params.dataIndex].c2 }]) } } } } ] SummarizeThis is the end of this article about the use of vue+echarts charts. For more relevant content on the use of vue+echarts charts, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Alibaba Cloud Server Tomcat cannot be accessed
>>: How to remotely connect to the cloud server database using Navicat
MYSQL version: MySQL Community Server 5.7.17, ins...
Select and change: click to display the current v...
How to view linux files Command to view file cont...
background The company code is provided to third ...
Solution to MySQL failure to start MySQL cannot s...
Table of contents Case Context switching overhead...
There was no problem connecting to the database y...
This article is mysql database Question 1 Import ...
VUE uses vue-seamless-scroll to automatically scr...
Preface This article summarizes some common MySQL...
Table of contents 1. Front-end routing implementa...
<br />For an article on a content page, if t...
1. First of all, we need to distinguish between t...
The effect is as follows:Reference Program: <!...
Preface A character set is a set of symbols and e...