VanOord / vue3-plotly

MIT License
10 stars 8 forks source link

mode bar still shows despite setting display-mode-bar="false" #1

Open PaulGuerry opened 1 year ago

PaulGuerry commented 1 year ago

image

image

I am trying to get rid of the mode bar. Am I doing something wrong ?

erkandem commented 1 year ago

I think it's a documentation error. display-mode-bar="false" is not picked up or passed on to the underlying plotly.js components. https://github.com/VanOord/vue3-plotly/blob/d3d878d6deb8aedab0b508370f9378543a66c7f4/src/VuePlotly.vue#L20

However, config is passed on and documented in plotly.js documentation. Try something like this:

<script setup>
import { ref } from 'vue'
import { VuePlotly } from 'vue3-plotly'
const chartData = ref({
      data:[{
        x: [1,2,3,4],
        y: [10,15,13,17],
        type:"scatter"
      }],
      layout:{
        title: "My graph"
      },
      config: {
          displayModeBar: false
      }
    })
</script>

<template>
<VuePlotly
    :data="chartData.data"
    :layout="chartData.data"
    :config="chartData.config"
/>
</template>
PaulGuerry commented 1 year ago

Hello,

I have finally got round to trying this and it seems to be working, thanks! Thanks also for the explanation.

Cheers,

Paul

On Thu, Mar 16, 2023 at 2:37 PM Erkan Demiralay @.***> wrote:

I think it's a documentation error. display-mode-bar="false" is not picked up or passed on to the underlying plotly.js components.

https://github.com/VanOord/vue3-plotly/blob/d3d878d6deb8aedab0b508370f9378543a66c7f4/src/VuePlotly.vue#L20

However, config is passed on and documented in plotly.js documentation. Try something like this:

— Reply to this email directly, view it on GitHub https://github.com/VanOord/vue3-plotly/issues/1#issuecomment-1471968515, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ5FM6JOBN2M44QYM7YQHWLW4MJRDANCNFSM6AAAAAAVK4JJ2A . You are receiving this because you authored the thread.Message ID: @.***>