The meaning and usage of echarts formatter {a,b,c,d}

headwind elegance 2022-08-06 08:22:43 阅读数:95

meaningusageechartsformatter

means as follows:

Line (area) chart, column (bar) chart: a (series name), b (category value), c (value), d (none)Scatter (Bubble) Plot : a (series name), b (data name), c (numeric array), d (none)Pie Chart, Radar Chart: a (series name), b (data item name), c (value), d (percentage)Chord diagram: a (series name), b (item 1 name), c (item 1-item 2 value), d (item 2 name), e (item 2-item 1 value)

Methods used:

In addition to using these fixed formatter letters, we can also use custom values

 // formatter, customize the displayed content, where p, q are the values ​​defined by yourself, item.p is the value of p, and \n means newlineformatter: '{b|{b}}\n{p|P:' + item.p + 'KW}\n{q|Q:' + item.q + 'KW}',backgroundColor: { // label's backgroundimage:bgcolor,},borderColor: '#aaa',borderWidth: 1,borderRadius: 4,rich: { // rich can set the style of p q b, that is | the content defined on the leftp: { // custom p stylecolor: '#3c3c3c',lineHeight: 22,align: 'center'},q:{ // custom q stylecolor: '#3c3c3c',lineHeight: 22,align: 'center'},b: { // style of bcolor: '#000',fontSize: 14,lineHeight: 20},}

版权声明:本文为[headwind elegance]所创,转载请带上原文链接,感谢。 https://javamana.com/2022/218/202208060818127740.html