Skip to content
Snippets Groups Projects
Commit a34fe3de authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

use margin to calculate plot width

parent 44a78cbc
No related branches found
No related tags found
No related merge requests found
Pipeline #129867 waiting for manual action with stages
in 5 minutes and 48 seconds
...@@ -60,7 +60,7 @@ onMounted(() => { ...@@ -60,7 +60,7 @@ onMounted(() => {
const plotContainer = ref(null) const plotContainer = ref(null)
const maxBarWidth = ref<number>(100) const maxBarWidth = ref<number>(80)
const computedWidth = computed(() => { const computedWidth = computed(() => {
const { marginLeft, marginRight } = toValue(margin) const { marginLeft, marginRight } = toValue(margin)
const filteredDistributionVal = toValue(filteredDistribution) const filteredDistributionVal = toValue(filteredDistribution)
...@@ -138,7 +138,7 @@ const distributionOptions = computed(() => { ...@@ -138,7 +138,7 @@ const distributionOptions = computed(() => {
marginLeft: 10, marginLeft: 10,
label: toValue(plotFill) === 'percent' ? toValue(plotLabelPercent) : toValue(plotLabelCount), label: toValue(plotFill) === 'percent' ? toValue(plotLabelPercent) : toValue(plotLabelCount),
}, },
width: computedWidth.value, width: computedWidth.value - marginLeft - marginRight,
marks: [ marks: [
Plot.barY( Plot.barY(
toValue(filteredDistribution), toValue(filteredDistribution),
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment