This commit is contained in:
duanxiaohai 2024-04-16 10:49:00 +08:00
parent 5097119c70
commit 9a7703b2a1
1 changed files with 72 additions and 63 deletions

View File

@ -36,38 +36,38 @@ let option = {
containLabel: true,
color: "#ffffff",
},
// dataZoom: [
// {
// show: zoomShow,
// type: "inside",
// startValue: 0,
// endValue: 2,
// minValueSpan: 2,
// maxValueSpan: 2,
// yAxisIndex: [0],
// zoomOnMouseWheel: false, //
// moveOnMouseWheel: true, //
// moveOnMouseMove: true, //
// },
// {
// show: zoomShow,
// type: "slider",
// realtime: true,
// startValue: 0,
// endValue: 2,
// width: "3.5",
// height: "80%",
// yAxisIndex: [0], // y
// fillerColor: "rgba(154, 181, 215, 1)", //
// borderColor: "rgba(17, 100, 210, 0.12)",
// backgroundColor: "#cfcfcf", //
// handleSize: 0, //
// showDataShadow: false, // auto
// showDetail: false, //
// top: "1%",
// right: "5",
// },
// ],
dataZoom: [
{
show: zoomShow,
type: "inside",
startValue: 0,
endValue: 2,
minValueSpan: 2,
maxValueSpan: 2,
yAxisIndex: [0],
zoomOnMouseWheel: false, //
moveOnMouseWheel: true, //
moveOnMouseMove: true, //
},
{
show: zoomShow,
type: "slider",
realtime: true,
startValue: 0,
endValue: 2,
width: "3.5",
height: "80%",
yAxisIndex: [0], // y
fillerColor: "rgba(154, 181, 215, 1)", //
borderColor: "rgba(17, 100, 210, 0.12)",
backgroundColor: "#cfcfcf", //
handleSize: 0, //
showDataShadow: false, // auto
showDetail: false, //
top: "1%",
right: "5",
},
],
calculable: true,
color: "rgba(0, 252, 255, 1)",
// label: {
@ -83,6 +83,7 @@ let option = {
// }
// },
xAxis: {
type: "value",
axisLabel: {
//
textStyle: {
@ -99,19 +100,13 @@ let option = {
},
},
yAxis: {
type: "category",
type: "category", //
data: data,
// max:10,
splitLine: {
//线
show: false,
lineStyle: {
color: "#ffffff",
width: 1,
},
},
axisLabel: {
//y
inside: false,
//
bargap: 0.5,
textStyle: {
color: "#ffffff",
},
@ -125,6 +120,22 @@ let option = {
type: "solid",
},
},
//
scrollbar: {
orient: "vertical",
//
height: 100,
},
// max:10,
splitLine: {
//线
show: false,
lineStyle: {
color: "#ffffff",
width: 1,
},
},
},
series: [
{
@ -134,29 +145,15 @@ let option = {
barGap: 0.3 /*多个并排柱子设置柱子之间的间距*/,
// barCategoryGap: "10" /**/,
itemStyle: {
// barBorderRadius: [0, 20, 20, 0],
// color: new this.$echarts.graphic.LinearGradient(0, 0, 1, 0, [ // color
// {
// offset: 0,
// color: '#FFF1AD'
// emphasis: {
// barBorderRadius: 7
// },
// {
// offset: 1,
// color: '#FC5090'
// }
// ]),
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(5, 213, 255, 1)", // 0%
},
{
offset: 0.98,
color: "rgba(5, 213, 255, 0)", // 100%
},
]), //
borderRadius: [0, 0, 50, 0], //
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
{ offset: 0, color: "rgba(26, 255, 217, 0)" },
{ offset: 1, color: "rgba(0, 183, 255, 1)" },
]),
},
},
},
@ -174,6 +171,18 @@ onMounted(() => {
// 使
myChart.setOption(option);
myChart.on("scroll", function (event) {
// bargap
var bargap = event.scrollData / 10000; // 1%0.5bargap
myChart.setOption({
yAxis: {
axisLabel: {
bargap: bargap,
},
},
});
});
// :
// window.addEventListener("resize", () => {
// myChart.resize();