Commit 1e283044 authored by Mike Greiling's avatar Mike Greiling

hide legend without hiding the axis labels

parent 2e66da48
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
); );
if (!this.showLegend) { if (!this.showLegend) {
this.baseGraphHeight -= 60; this.baseGraphHeight -= 50;
} else if (this.timeSeries.length > 3) { } else if (this.timeSeries.length > 3) {
this.baseGraphHeight = this.baseGraphHeight += (this.timeSeries.length - 3) * 20; this.baseGraphHeight = this.baseGraphHeight += (this.timeSeries.length - 3) * 20;
} }
...@@ -253,7 +253,6 @@ ...@@ -253,7 +253,6 @@
transform="translate(70, 20)" transform="translate(70, 20)"
/> />
<graph-legend <graph-legend
v-if="showLegend"
:graph-width="graphWidth" :graph-width="graphWidth"
:graph-height="graphHeight" :graph-height="graphHeight"
:margin="margin" :margin="margin"
...@@ -263,6 +262,7 @@ ...@@ -263,6 +262,7 @@
:time-series="timeSeries" :time-series="timeSeries"
:unit-of-display="unitOfDisplay" :unit-of-display="unitOfDisplay"
:current-data-index="currentDataIndex" :current-data-index="currentDataIndex"
:show-legend-group="showLegend"
/> />
<svg <svg
class="graph-data" class="graph-data"
......
...@@ -39,6 +39,11 @@ ...@@ -39,6 +39,11 @@
type: Number, type: Number,
required: true, required: true,
}, },
showLegendGroup: {
type: Boolean,
required: false,
default: true,
},
}, },
data() { data() {
return { return {
...@@ -166,6 +171,7 @@ ...@@ -166,6 +171,7 @@
> >
Time Time
</text> </text>
<template v-if="showLegendGroup">
<g <g
class="legend-group" class="legend-group"
v-for="(series, index) in timeSeries" v-for="(series, index) in timeSeries"
...@@ -200,5 +206,6 @@ ...@@ -200,5 +206,6 @@
{{ legendTitle }} {{ formatMetricUsage(series) }} {{ legendTitle }} {{ formatMetricUsage(series) }}
</text> </text>
</g> </g>
</template>
</g> </g>
</template> </template>
Markdown is supported
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