fix(chart): render title and profile legend by default

Vue casts an absent boolean prop to false, so withChrome was always
false and the v-if="withChrome !== false" guards hid the title and
legend everywhere — including the PNG export. Default withChrome to
true via withDefaults so the legend renders.
This commit is contained in:
Julien Calixte
2026-06-17 09:41:42 +02:00
parent b203cd3ca4
commit 8e751e77b7

View File

@@ -3,11 +3,14 @@ import { computed } from 'vue'
import type { Radar } from '../types'
import { MAX_SCORE } from '../types'
const props = defineProps<{
radar: Radar
/** If true, the SVG renders Radar name (top) and legend (bottom). */
withChrome?: boolean
}>()
const props = withDefaults(
defineProps<{
radar: Radar
/** Renders the radar name (top) and profile legend (bottom). Defaults to true. */
withChrome?: boolean
}>(),
{ withChrome: true },
)
const WIDTH = 720
const HEIGHT = computed(() => (props.withChrome === false ? 600 : 800))