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