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
A singly linked list can only be traversed from t...
Overview In actual business scenario applications...
Table of contents Workaround Why can't I moni...
Without further ado, these three methods are: ren...
Today, when I was practicing with the Baidu page,...
Today I will introduce two HTML tags that I don’t...
Hexadecimal code table of various colors [Part 1] ...
I hope to implement some properties of the query ...
1 Download the MySQL 5.6 version compressed packa...
Many people may ask, does the text on the website...
1. Download and install VirtualBox software First...
I have been learning about responsive design rece...
Preface This control will have a watermark at the...
The equal-width layout described in this article ...
This article shares with you how to use Vue to ch...