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) {
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,
type: "line",
symbol: "circle",

View File

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