This commit is contained in:
Fine 2025-01-09 14:57:02 +08:00
parent a831008c39
commit b6f88275ca
2 changed files with 6 additions and 4 deletions

View File

@ -76,7 +76,7 @@ limitations under the License. -->
}); });
for (const item of metric.values) { for (const item of metric.values) {
series.push({ series.push({
data: item.values.map((item: any, itemIndex: number) => [props.intervalTime[itemIndex], item]), data: item.values.map((item: number, itemIndex: number) => [props.intervalTime[itemIndex], item]),
name: metric.name, name: metric.name,
type: "line", type: "line",
symbol: "circle", symbol: "circle",

View File

@ -69,10 +69,12 @@ limitations under the License. -->
function getOption() { function getOption() {
const { showEchartsLegend, isRight, chartColors } = useLegendProcess(props.config.legend); const { showEchartsLegend, isRight, chartColors } = useLegendProcess(props.config.legend);
setRight.value = isRight; setRight.value = isRight;
const keys = Object.keys(props.data || {}).filter((i: any) => Array.isArray(props.data[i]) && props.data[i].length); const keys = Object.keys(props.data || {}).filter(
const temp = keys.map((i: any) => { (i: string) => Array.isArray(props.data[i]) && props.data[i].length,
);
const temp = keys.map((i: string) => {
const serie: any = { const serie: any = {
data: props.data[i].map((item: any, itemIndex: number) => [props.intervalTime[itemIndex], item]), data: props.data[i].map((item: number, itemIndex: number) => [props.intervalTime[itemIndex], item]),
name: i, name: i,
type: "line", type: "line",
symbol: "circle", symbol: "circle",