<template>
<div id="main" class="echart-style">
</div>
</template>
<script setup lang="ts">
import * as echarts from 'echarts';
import { onMounted, ref } from 'vue';
let myChart = ref()
let option = ref({})
let data = ref([900, 345, 393, -108, -154, 135, 178, 286, -119, -361, -203]);
let help: any = [];
let positive: any = [];
let negative: any = [];
for (let i = 0, sum = 0; i < data.value.length; ++i) {
if (data.value[i] >= 0) {
positive.push(data.value[i]);
negative.push('-');
} else {
positive.push('-');
negative.push(-data.value[i]);
}
if (i === 0) {
help.push(0);
} else {
sum += data.value[i - 1];
if (data.value[i] < 0) {
help.push(sum + data.value[i]);
} else {
help.push(sum);
}
}
}
onMounted(() =>