This commit is contained in:
Fine 2025-02-20 15:53:48 +08:00
parent 534d020f51
commit 4e5181dd8a
3 changed files with 4 additions and 3 deletions

View File

@ -61,7 +61,7 @@ limitations under the License. -->
import Trace from "@/views/dashboard/related/trace/Index.vue";
import associateProcessor from "@/hooks/useAssociateProcessor";
import { WidgetType } from "@/views/dashboard/data";
import SelectorLegend from "./SelectorLegend.vue";
import SelectorLegend from "./Legend.vue";
/*global Nullable, defineProps, defineEmits, Indexable*/
const emits = defineEmits(["select"]);

View File

@ -51,14 +51,14 @@ limitations under the License. -->
},
});
const emits = defineEmits(["change"]);
const legend = ref<string[]>([]);
const Options = computed(() =>
props.data.map((d: { name: string }, index: number) => ({
label: d.name,
value: d.name,
color: props.colors[index],
color: props.colors[index % props.colors.length],
})),
);
const legend = ref<string[]>([]);
function changeLegend(opt: Option[]) {
legend.value = opt.map((d: Option) => d.value);

View File

@ -46,6 +46,7 @@ declare module 'vue' {
ElTooltip: typeof import('element-plus/es')['ElTooltip']
Graph: typeof import('./../components/Graph/Graph.vue')['default']
Icon: typeof import('./../components/Icon.vue')['default']
Legend: typeof import('./../components/Graph/Legend.vue')['default']
Radio: typeof import('./../components/Radio.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']