krmao commented on issue #17080:
URL: https://github.com/apache/echarts/issues/17080#issuecomment-2063548113

   ### There is a solution, you can make a try
   
   1. zoom such as 0.7 on body
   2. unzoom on echarts 1/0.7
   3. transform scale 0.7
   4. transfromOrigin 0 0
   
   ### Here is my code, ***Take it, no thanks needed.***
   ```
   <template>
     <div :style="{ width: props.width, height: props.height, minHeight: 
props.minHeight }">
       <div ref="lineChartRef" :style="style">
         <slot />
       </div>
     </div>
   </template>
   
   <script setup lang="ts">
   import { useZoomStore } from "@/store/modules/zoom";
   import { computed } from "vue";
   import WindowResizeUtil from "@/utils/windowResizeUtil";
   
   //region defineOptions
   defineOptions({ name: "ZoomContainer" });
   
   const props = withDefaults(
     defineProps<{
       width?: number | string;
       height?: number | string;
       minHeight?: number | string;
     }>(),
     {
       width: "100%",
       height: "100%",
       minHeight: "100%"
     }
   );
   const zoomStore = useZoomStore();
   const style = computed(() => {
     if (WindowResizeUtil.getSystem() && zoomStore.zoom < 1) {
       return {
         width: `calc(100% * ${1 / zoomStore.zoom})`,
         height: `calc(100% * ${1 / zoomStore.zoom})`,
         zoom: 1 / zoomStore.zoom,
         transform: `scale(${zoomStore.zoom},${zoomStore.zoom})`,
         transformOrigin: "0 0"
       };
     } else {
       return {
         width: "100%",
         height: "100%"
       };
     }
   });
   </script>
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to