|
|
|
|
@ -154,11 +154,12 @@ const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
|
|
|
|
|
let option = {
|
|
|
|
|
grid: {
|
|
|
|
|
left: "0%",
|
|
|
|
|
right: "5%",
|
|
|
|
|
right: "8%",
|
|
|
|
|
bottom: "0%",
|
|
|
|
|
top: "0%",
|
|
|
|
|
containLabel: true,
|
|
|
|
|
},
|
|
|
|
|
dataZoom:[],
|
|
|
|
|
xAxis: {
|
|
|
|
|
show: false,
|
|
|
|
|
},
|
|
|
|
|
@ -180,28 +181,6 @@ const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
|
|
|
|
|
color: "#fff",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
show: true,
|
|
|
|
|
inverse: true,
|
|
|
|
|
data: data.yData,
|
|
|
|
|
axisLabel: {
|
|
|
|
|
textStyle: {
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: "#fff",
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
formatter: '{value}%'
|
|
|
|
|
},
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: false,
|
|
|
|
|
},
|
|
|
|
|
splitLine: {
|
|
|
|
|
show: false,
|
|
|
|
|
},
|
|
|
|
|
axisTick: {
|
|
|
|
|
show: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
@ -223,10 +202,21 @@ const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
|
|
|
|
|
{
|
|
|
|
|
name: "框",
|
|
|
|
|
type: "bar",
|
|
|
|
|
yAxisIndex: 1,
|
|
|
|
|
yAxisIndex: 0,
|
|
|
|
|
barGap: "-100%",
|
|
|
|
|
data: bgBar,
|
|
|
|
|
barWidth: '90%',
|
|
|
|
|
barWidth: '80%',
|
|
|
|
|
label: {
|
|
|
|
|
show: true,
|
|
|
|
|
position: "right",
|
|
|
|
|
textStyle: {
|
|
|
|
|
color: "#fff",
|
|
|
|
|
fontSize: 0.75 * vw
|
|
|
|
|
},
|
|
|
|
|
formatter: function (val,index,e) {
|
|
|
|
|
return data.yData[val.dataIndex] +'%'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
color: "none",
|
|
|
|
|
@ -239,20 +229,36 @@ const horizontalRoundedBarChartWithBackgroundTwo = function (data, id) {
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// if (data.xData?.length >= 3) {
|
|
|
|
|
// option.dataZoom.push({
|
|
|
|
|
// show: true,
|
|
|
|
|
// type: 'slider',
|
|
|
|
|
// yAxisIndex: 0,
|
|
|
|
|
// width: 0.75 * vw,
|
|
|
|
|
// start: 0,
|
|
|
|
|
// end: 1 / (data.xData.length / 4) * 100,
|
|
|
|
|
// textStyle: {
|
|
|
|
|
// fontSize: 0,
|
|
|
|
|
// color: 'rgba(0,0,0,0)'
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
if (data.yNameOne.length > 8) {
|
|
|
|
|
option.dataZoom.push({
|
|
|
|
|
show: false,
|
|
|
|
|
type: 'slider',
|
|
|
|
|
bottom: '0%',
|
|
|
|
|
yAxisIndex: 0,
|
|
|
|
|
height: 12,
|
|
|
|
|
start: 0,
|
|
|
|
|
end: 1 / (data.yNameOne.length / 9) * 100,
|
|
|
|
|
textStyle: {
|
|
|
|
|
fontSize: 0,
|
|
|
|
|
color: 'rgba(0,0,0,0)'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let step = 1 / (data.yNameOne.length / 9) * 100
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
option.dataZoom[0].end += step
|
|
|
|
|
option.dataZoom[0].start += step
|
|
|
|
|
if (option.dataZoom[0].start >= 100) {
|
|
|
|
|
option.dataZoom[0].start = 0
|
|
|
|
|
option.dataZoom[0].end = step
|
|
|
|
|
}
|
|
|
|
|
if (option.dataZoom[0].end >= 100) {
|
|
|
|
|
option.dataZoom[0].end = 100
|
|
|
|
|
option.dataZoom[0].start = option.dataZoom[0].end - step
|
|
|
|
|
}
|
|
|
|
|
charts.setOption(option);
|
|
|
|
|
}, 3000)
|
|
|
|
|
}
|
|
|
|
|
charts.setOption(option);
|
|
|
|
|
$(window).resize(charts.resize);
|
|
|
|
|
}
|
|
|
|
|
|