diff --git a/src/hooks/useLegendProcessor.ts b/src/hooks/useLegendProcessor.ts index 366cda74..3c0f3aa9 100644 --- a/src/hooks/useLegendProcessor.ts +++ b/src/hooks/useLegendProcessor.ts @@ -14,3 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { LegendOptions } from "@/types/dashboard"; + +export default function useLegendProcess() { + function showEchartsLegend(keys: string[], legend?: LegendOptions) { + if (keys.length === 1) { + return false; + } + if (legend && legend.asTable) { + return false; + } + return true; + } + return { showEchartsLegend }; +} diff --git a/src/views/dashboard/configuration/widget/graph-styles/components/Legend.vue b/src/views/dashboard/configuration/widget/graph-styles/components/Legend.vue index f22f2ce6..9d76c5e6 100644 --- a/src/views/dashboard/configuration/widget/graph-styles/components/Legend.vue +++ b/src/views/dashboard/configuration/widget/graph-styles/components/Legend.vue @@ -14,14 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. -->