mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-01-24 15:14:01 +08:00
Try fix echart build error
This commit is contained in:
parent
c2f7c6af47
commit
d83183f0ae
@ -1,12 +1,12 @@
|
||||
import { init, graphic, type ECharts } from "echarts";
|
||||
import { onMounted, onUnmounted, ref } from "vue";
|
||||
|
||||
export function useSimpleChart(dom: string, initData: number[] = []) {
|
||||
export function useSimpleChart(dom: string) {
|
||||
let chart = ref<ECharts>();
|
||||
|
||||
onMounted(() => {
|
||||
chart.value = init(document.getElementById(dom));
|
||||
chart.value.setOption(getSimpleChartDefaultOption(initData));
|
||||
chart.value.setOption(getSimpleChartDefaultOption());
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
@ -40,7 +40,7 @@ export function useOverviewChart(dom: string) {
|
||||
}
|
||||
|
||||
function getChartDefaultOption() {
|
||||
const color: any = new graphic.LinearGradient(0, 0, 0, 1, [
|
||||
const color = new graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: "rgb(67, 145, 250,0.8)"
|
||||
@ -77,8 +77,7 @@ function getChartDefaultOption() {
|
||||
};
|
||||
}
|
||||
|
||||
function getSimpleChartDefaultOption(data: number[] = []) {
|
||||
// const randomNumbers = Array.from({ length: 60 }, () => 0);
|
||||
function getSimpleChartDefaultOption() {
|
||||
return {
|
||||
grid: {
|
||||
show: false,
|
||||
@ -92,7 +91,6 @@ function getSimpleChartDefaultOption(data: number[] = []) {
|
||||
yAxis: { type: "value", min: 0, max: 100, show: false, minInterval: 1 },
|
||||
series: [
|
||||
{
|
||||
// data: data || randomNumbers,
|
||||
type: "line",
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
|
3
package-lock.json
generated
3
package-lock.json
generated
@ -5,7 +5,8 @@
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"echarts": "^5.4.3"
|
||||
"echarts": "^5.4.3",
|
||||
"zrender": "^5.4.4"
|
||||
}
|
||||
},
|
||||
"node_modules/echarts": {
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"echarts": "^5.4.3"
|
||||
"echarts": "^5.4.3",
|
||||
"zrender": "^5.4.4"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user