fix: clean up
This commit is contained in:
parent
ba8ec8dcdd
commit
3540f9ec01
|
|
@ -83,7 +83,7 @@ function handleLegendItemClick(d: BulletLegendItemInterface, i: number) {
|
||||||
|
|
||||||
<template v-for="(category, i) in categories" :key="category">
|
<template v-for="(category, i) in categories" :key="category">
|
||||||
<VisArea
|
<VisArea
|
||||||
:x="(_: Data, i: number) => i"
|
:x="(_d: Data, i: number) => i"
|
||||||
:y="(d: Data) => d[category]"
|
:y="(d: Data) => d[category]"
|
||||||
color="auto"
|
color="auto"
|
||||||
:curve-type="curveType"
|
:curve-type="curveType"
|
||||||
|
|
@ -98,7 +98,7 @@ function handleLegendItemClick(d: BulletLegendItemInterface, i: number) {
|
||||||
|
|
||||||
<template v-for="(category, i) in categories" :key="category">
|
<template v-for="(category, i) in categories" :key="category">
|
||||||
<VisLine
|
<VisLine
|
||||||
:x="(_: Data, i: number) => i"
|
:x="(_d: Data, i: number) => i"
|
||||||
:y="(d: Data) => d[category]"
|
:y="(d: Data) => d[category]"
|
||||||
:color="colors[i]"
|
:color="colors[i]"
|
||||||
:curve-type="curveType"
|
:curve-type="curveType"
|
||||||
|
|
|
||||||
|
|
@ -71,14 +71,14 @@ const selectorsBar = computed(() => props.type === 'grouped' ? GroupedBar.select
|
||||||
<ChartCrosshair v-if="showTooltip" :colors="colors" :items="legendItems" :custom-tooltip="customTooltip" :index="index" />
|
<ChartCrosshair v-if="showTooltip" :colors="colors" :items="legendItems" :custom-tooltip="customTooltip" :index="index" />
|
||||||
|
|
||||||
<VisBarComponent
|
<VisBarComponent
|
||||||
:x="(_: Data, i: number) => i"
|
:x="(_d: Data, i: number) => i"
|
||||||
:y="categories.map(category => (d: Data) => d[category]) "
|
:y="categories.map(category => (d: Data) => d[category]) "
|
||||||
:color="colors"
|
:color="colors"
|
||||||
:rounded-corners="roundedCorners"
|
:rounded-corners="roundedCorners"
|
||||||
:bar-padding="0.05"
|
:bar-padding="0.05"
|
||||||
:attributes="{
|
:attributes="{
|
||||||
[selectorsBar]: {
|
[selectorsBar]: {
|
||||||
opacity: (_: Data, i:number) => {
|
opacity: (_d: Data, i:number) => {
|
||||||
const pos = i % categories.length
|
const pos = i % categories.length
|
||||||
return legendItems[pos]?.inactive ? filterOpacity : 1
|
return legendItems[pos]?.inactive ? filterOpacity : 1
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ const totalValue = computed(() => props.data.reduce((prev, curr) => {
|
||||||
:central-label="type === 'donut' ? valueFormatter(totalValue) : ''"
|
:central-label="type === 'donut' ? valueFormatter(totalValue) : ''"
|
||||||
:events="{
|
:events="{
|
||||||
[Donut.selectors.segment]: {
|
[Donut.selectors.segment]: {
|
||||||
click: (d: Data, _: PointerEvent, i: number, elements: HTMLElement[]) => {
|
click: (d: Data, _ev: PointerEvent, i: number, elements: HTMLElement[]) => {
|
||||||
if (d?.data?.[index] === activeSegmentKey) {
|
if (d?.data?.[index] === activeSegmentKey) {
|
||||||
activeSegmentKey = undefined
|
activeSegmentKey = undefined
|
||||||
elements.forEach(el => el.style.opacity = '1')
|
elements.forEach(el => el.style.opacity = '1')
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ function handleLegendItemClick(d: BulletLegendItemInterface, i: number) {
|
||||||
|
|
||||||
<template v-for="(category, i) in categories" :key="category">
|
<template v-for="(category, i) in categories" :key="category">
|
||||||
<VisLine
|
<VisLine
|
||||||
:x="(_: Data, i: number) => i"
|
:x="(_d: Data, i: number) => i"
|
||||||
:y="(d: Data) => d[category]"
|
:y="(d: Data) => d[category]"
|
||||||
:curve-type="curveType"
|
:curve-type="curveType"
|
||||||
:color="colors[i]"
|
:color="colors[i]"
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ function template(d: any) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function color(_: unknown, i: number) {
|
function color(_d: unknown, i: number) {
|
||||||
return props.colors[i] ?? 'transparent'
|
return props.colors[i] ?? 'transparent'
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user