From 7c6a0bd38057022eaaa13d41635e92412734e483 Mon Sep 17 00:00:00 2001 From: Fine Date: Mon, 7 Nov 2022 21:16:22 +0800 Subject: [PATCH] update style with config --- src/hooks/useLegendProcessor.ts | 11 +++++------ src/views/dashboard/graphs/Bar.vue | 4 ++-- src/views/dashboard/graphs/Line.vue | 3 +-- src/views/dashboard/graphs/components/Legend.vue | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/hooks/useLegendProcessor.ts b/src/hooks/useLegendProcessor.ts index e2ee48ee..58aedc08 100644 --- a/src/hooks/useLegendProcessor.ts +++ b/src/hooks/useLegendProcessor.ts @@ -17,6 +17,10 @@ import { LegendOptions } from "@/types/dashboard"; export default function useLegendProcess(legend?: LegendOptions) { + let isRight = false; + if (legend && legend.toTheRight) { + isRight = true; + } function showEchartsLegend(keys: string[]) { if (legend && !legend.show === undefined) { return legend.show; @@ -29,11 +33,6 @@ export default function useLegendProcess(legend?: LegendOptions) { } return true; } - function isRight() { - if (legend && legend.toTheRight) { - return true; - } - return false; - } + return { showEchartsLegend, isRight }; } diff --git a/src/views/dashboard/graphs/Bar.vue b/src/views/dashboard/graphs/Bar.vue index 48efdf92..a3627e80 100644 --- a/src/views/dashboard/graphs/Bar.vue +++ b/src/views/dashboard/graphs/Bar.vue @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->