TokenomicsSection

main
Thuong_e 2 years ago
parent bc26398673
commit 9fe7b4e40a
  1. 26
      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,
},

Loading…
Cancel
Save