|
@@ -1231,89 +1231,77 @@ export default {
|
|
|
,
|
|
|
qkq_aqcn_chart() {
|
|
|
var myChart = echarts.init(document.getElementById('qkq_aqcn_chart'));
|
|
|
- // mock数据
|
|
|
- const mockData = {
|
|
|
- value: 100,
|
|
|
- name: '承诺率'
|
|
|
- }
|
|
|
- // 渐变色
|
|
|
- var color = [
|
|
|
- { offset: 0, color: 'rgba(0, 170, 255, 0.5)' },
|
|
|
- { offset: 0.6, color: 'rgba(0, 170, 255, 0.6)' },
|
|
|
- { offset: 0.95, color: 'rgba(0, 170, 255, 0.7)' },
|
|
|
- { offset: 1, color: 'rgba(0, 170, 255, 0.9)' }
|
|
|
- ];
|
|
|
-
|
|
|
- // 圆环宽度
|
|
|
- const barMaxWidth = 10
|
|
|
-
|
|
|
- // 坐标轴
|
|
|
- const angleAxis = {
|
|
|
- show: false,
|
|
|
- max: 100 * 360 / 270,
|
|
|
- type: 'value',
|
|
|
- startAngle: 225,
|
|
|
- splitLine: { show: false }
|
|
|
- }
|
|
|
-
|
|
|
- // 坐标轴
|
|
|
- const radiusAxis = {
|
|
|
- show: false,
|
|
|
- type: 'category',
|
|
|
- }
|
|
|
-
|
|
|
- //圆环位置和大小
|
|
|
- const polar = {
|
|
|
- center: ['50%', '60%'],
|
|
|
- radius: '175%'
|
|
|
- }
|
|
|
- const series = [{
|
|
|
- type: 'bar',
|
|
|
- data: [{
|
|
|
- //上层圆环,显示数据
|
|
|
- value: mockData.value,
|
|
|
- itemStyle: {
|
|
|
- color: { type: 'linear', x: 0, y: 0, x2: 1, y2: 0, colorStops: color, },
|
|
|
- },
|
|
|
- }],
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
-
|
|
|
- formatter: params => {
|
|
|
- return `{a|${params.value}}{b| %}\n\n\n{c|${mockData.name}}`
|
|
|
- },
|
|
|
- rich: {
|
|
|
- a: { fontSize: 18, verticalAlign: 'bottom' },
|
|
|
- b: { fontSize: 16, verticalAlign: 'bottom' },
|
|
|
- c: { fontSize: 14 }
|
|
|
- },
|
|
|
- itemStyle: {
|
|
|
- normal: {
|
|
|
- color: "#fff"
|
|
|
- }
|
|
|
- },
|
|
|
- },
|
|
|
-
|
|
|
- barGap: '-100%',
|
|
|
- coordinateSystem: 'polar',
|
|
|
- roundCap: true,
|
|
|
- z: 2
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'bar',
|
|
|
- data: [{
|
|
|
- value: 100,
|
|
|
- itemStyle: { color: 'rgba(0, 36, 109, 0.3)' }
|
|
|
- }],
|
|
|
- barGap: '-100%',
|
|
|
- coordinateSystem: 'polar',
|
|
|
- roundCap: true,
|
|
|
- z: 1
|
|
|
- }]
|
|
|
- // 渲染
|
|
|
- var option = { barMaxWidth, radiusAxis, polar, angleAxis, series};
|
|
|
-
|
|
|
-
|
|
|
+ var getvalue=[100];
|
|
|
+
|
|
|
+ var option = {
|
|
|
+ title: {
|
|
|
+ text: getvalue+'%',
|
|
|
+ textStyle: {
|
|
|
+ color: '#00aaff',
|
|
|
+ fontSize: 18
|
|
|
+ },
|
|
|
+ subtext: '承诺率',
|
|
|
+ subtextStyle: {
|
|
|
+ color: '#fff',
|
|
|
+ fontSize: 16
|
|
|
+ },
|
|
|
+ itemGap: 10,
|
|
|
+ left: 'center',
|
|
|
+ top: '37%'
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+
|
|
|
+ },
|
|
|
+ angleAxis: {
|
|
|
+ max: 100,
|
|
|
+ clockwise: true, // 逆时针
|
|
|
+ // 隐藏刻度线
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ radiusAxis: {
|
|
|
+ type: 'category',
|
|
|
+ show: true,
|
|
|
+ axisLabel: {
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ show: false,
|
|
|
+
|
|
|
+ },
|
|
|
+ axisTick: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ },
|
|
|
+ polar: {
|
|
|
+ center: ['50%', '60%'],
|
|
|
+ radius: '150%' //图形大小
|
|
|
+ },
|
|
|
+ series: [{
|
|
|
+ type: 'bar',
|
|
|
+ data: getvalue,
|
|
|
+ showBackground: true,
|
|
|
+ backgroundStyle: {
|
|
|
+ color: '#BDEBFF',
|
|
|
+ },
|
|
|
+ coordinateSystem: 'polar',
|
|
|
+ roundCap: true,
|
|
|
+ barWidth: 5,
|
|
|
+ itemStyle: {
|
|
|
+ normal: {
|
|
|
+ opacity: 1,
|
|
|
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
|
|
|
+ offset: 0,
|
|
|
+ color: '#25BFFF'
|
|
|
+ }, {
|
|
|
+ offset: 1,
|
|
|
+ color: '#5284DE'
|
|
|
+ }]),
|
|
|
+ shadowBlur: 5,
|
|
|
+ shadowColor: '#2A95F9',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }]
|
|
|
+ };
|
|
|
if (option) {
|
|
|
myChart.setOption(option);
|
|
|
}
|