From 9fe7b4e40ac2784676c28c5ca44da8131fa9c965 Mon Sep 17 00:00:00 2001 From: Thuong_e Date: Fri, 14 Apr 2023 09:59:53 +0700 Subject: [PATCH] TokenomicsSection --- .../components/home/TokenomicsSection.tsx | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/src/shared/components/home/TokenomicsSection.tsx b/src/shared/components/home/TokenomicsSection.tsx index 3dd1f44..2bbceca 100644 --- a/src/shared/components/home/TokenomicsSection.tsx +++ b/src/shared/components/home/TokenomicsSection.tsx @@ -120,24 +120,7 @@ const TokenomicsSection = (props: Props) => { const plugins = { id: "textCenter", datalabels: {}, - // beforeDatasetsDraw(chart: any, arg: any, pluginsOptions: any) { - // const { ctx, data } = chart; - // ctx.save(); - // ctx.fillStyle = "#fff"; - // ctx.font = "bolder 30px sen"; - // ctx.textAlign = "center"; - // ctx.textBaseline = "middle"; - // ctx.fillText( - // `TOTAL SUPPLE`, - // chart.getDatasetMeta(0).data[0].x, - // chart.getDatasetMeta(0).data[0].y - 20 - // ); - // ctx.fillText( - // `20,000,000 SGPT`, - // chart.getDatasetMeta(0).data[0].x, - // chart.getDatasetMeta(0).data[0].y + 25 - // ); - // }, + }; const [userData, setUserData] = useState({ labels: tokenomics.map((data) => data.name), @@ -146,13 +129,12 @@ const TokenomicsSection = (props: Props) => { label: "text", data: tokenomics.map((data) => data.precent), backgroundColor: tokenomics.map((data) => data.color), - // cutout: "40%", borderWidth: 1, datalabels: { font: { weight: "bold", }, - anchor: "center", //start, center, end + anchor: "center", rotation: function (ctx: any) { const valuesBefore = ctx.dataset.data .slice(0, ctx.dataIndex) @@ -169,10 +151,6 @@ const TokenomicsSection = (props: Props) => { 360; return rotation < 180 ? rotation - 95 : rotation + 90; }, - // formatter: function (value: any, context: any) { - // return context.chart.data.labels[context.dataIndex]; - // }, - // anchor: "end", align: "center", offset: -30, },