<script setup lang="ts">
import { computed } from 'vue'
import chartService from '@/services/ChartService'
import type IStat from '@/models/IStat'

const props = defineProps<{
  stat: IStat
  index: number
  total: number
}>()

const point = computed(() =>
  chartService.valueToPoint(props.stat.percent + 10, props.index, props.total)
)
</script>

<template>
  <text :x="point.x" :y="point.y">{{ stat.label }}</text>
</template>
