|
|
@ -120,24 +120,7 @@ const TokenomicsSection = (props: Props) => { |
|
|
|
const plugins = { |
|
|
|
const plugins = { |
|
|
|
id: "textCenter", |
|
|
|
id: "textCenter", |
|
|
|
datalabels: {}, |
|
|
|
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({ |
|
|
|
const [userData, setUserData] = useState({ |
|
|
|
labels: tokenomics.map((data) => data.name), |
|
|
|
labels: tokenomics.map((data) => data.name), |
|
|
@ -146,13 +129,12 @@ const TokenomicsSection = (props: Props) => { |
|
|
|
label: "text", |
|
|
|
label: "text", |
|
|
|
data: tokenomics.map((data) => data.precent), |
|
|
|
data: tokenomics.map((data) => data.precent), |
|
|
|
backgroundColor: tokenomics.map((data) => data.color), |
|
|
|
backgroundColor: tokenomics.map((data) => data.color), |
|
|
|
// cutout: "40%",
|
|
|
|
|
|
|
|
borderWidth: 1, |
|
|
|
borderWidth: 1, |
|
|
|
datalabels: { |
|
|
|
datalabels: { |
|
|
|
font: { |
|
|
|
font: { |
|
|
|
weight: "bold", |
|
|
|
weight: "bold", |
|
|
|
}, |
|
|
|
}, |
|
|
|
anchor: "center", //start, center, end
|
|
|
|
anchor: "center",
|
|
|
|
rotation: function (ctx: any) { |
|
|
|
rotation: function (ctx: any) { |
|
|
|
const valuesBefore = ctx.dataset.data |
|
|
|
const valuesBefore = ctx.dataset.data |
|
|
|
.slice(0, ctx.dataIndex) |
|
|
|
.slice(0, ctx.dataIndex) |
|
|
@ -169,10 +151,6 @@ const TokenomicsSection = (props: Props) => { |
|
|
|
360; |
|
|
|
360; |
|
|
|
return rotation < 180 ? rotation - 95 : rotation + 90; |
|
|
|
return rotation < 180 ? rotation - 95 : rotation + 90; |
|
|
|
}, |
|
|
|
}, |
|
|
|
// formatter: function (value: any, context: any) {
|
|
|
|
|
|
|
|
// return context.chart.data.labels[context.dataIndex];
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// anchor: "end",
|
|
|
|
|
|
|
|
align: "center", |
|
|
|
align: "center", |
|
|
|
offset: -30, |
|
|
|
offset: -30, |
|
|
|
}, |
|
|
|
}, |
|
|
|