lijinlong
李劲龙 5 months ago
parent 81c1be1ce5
commit bf790ba234

@ -46,58 +46,78 @@ export default {
methods: {
initChart() {
this.chart = echarts.init(document.getElementById('BJinsannianzijinchart-left'))
const option = {
var value1 = Math.random() * 100; //
var value2 = 300 - value1; // 100
//
var minOffset = value1 / 100; //
var maxOffset = (value1 + value2) / 100; // 100maxOffset1
let option = {
series: [
{
type: 'gauge',
splitNumber: 3,
radius: '93%',
center: ["50%", "70%"],
startAngle: 180,
endAngle: 0,
center: ['50%', '80%'],
radius: '100%',
min: 0,
max: 100,
pointer: {
show: true,
width: 7,
length: "60%",
borderColor: '#000',
borderWidth: '10',
},
axisLine: {
show: true,
lineStyle: {
width: 30,
width: 35,
color: [
[0.298, '#2d99e2'],
[1, '#dce3ec'],
[0.5, '#7BB2FF'], //
[0.6, '#000'],
[1, '#4186FF'] //
],
},
},
axisTick: { show: false },
axisLabel: { show: false },
splitLine: { show: false },
pointer: {
offsetCenter: [0, '10%'],
icon: 'path://M0,0 L0,-20 L5,-20 L5,-30 L15,-30 L15,-20 L20,-20 L20,0 Z', // + 线 +
length: '80%', //
itemStyle: {
color: '#000',
width: 2, //
axisLabel: {
show: true,
color: "#666",
fontSize: 16,
formatter: function (value) {
return value.toFixed(0);
},
},
title: {
show: true,
offsetCenter: [0, '25%'],
textStyle: {
color: '#2d99e2',
fontSize: 15,
fontFamily: '微软雅黑',
fontWeight: 'bold',
axisTick: {
show: false,
},
splitLine: {
show: false,
length: "28%",
lineStyle: {
color: "#fff",
width: 2,
},
},
detail: {
show: false,
show: false
},
title: {
show: false
},
data: [
{
value: 29.8,
name: '你要的比例 29.8%',
},
value: value1,
name: '决策层国际化导向'
}
],
},
],
}
]
};
this.chart.setOption(
option
)

Loading…
Cancel
Save