Better piechart

This commit is contained in:
Marco van Dijk 2022-04-21 22:25:27 +02:00
parent 1c2c36a9d6
commit b230e1ba67

View File

@ -11,7 +11,7 @@ const WinnerMonth = (obj) => {
const [thisScores, setThisScores] = useState(null); const [thisScores, setThisScores] = useState(null);
useEffect(() => { useEffect(() => {
const setScore = async() => { const setScore = async () => {
if (!obj.data.testScores) { if (!obj.data.testScores) {
const freshScore = await getOrchestratorScores(obj.data.year, obj.data.month); const freshScore = await getOrchestratorScores(obj.data.year, obj.data.month);
if (freshScore) { if (freshScore) {
@ -50,14 +50,14 @@ const WinnerMonth = (obj) => {
if (thisAddr.name) { if (thisAddr.name) {
return thisAddr.name; return thisAddr.name;
} else { } else {
return (address.substring(0, 10) + ".."); return (address.substring(0, 14) + "..");
} }
break; break;
} }
} }
} }
return (address.substring(0, 10) + ".."); return (address.substring(0, 14) + "..");
} }
// Show all orchs (if latestTotalStake exists) or show only those in winningTicketsReceived // Show all orchs (if latestTotalStake exists) or show only those in winningTicketsReceived
@ -127,7 +127,10 @@ const WinnerMonth = (obj) => {
labels: { labels: {
fontSize: 10, zIndex: 999 fontSize: 10, zIndex: 999
} }
}} /> }}
labelPosition="centroid"
labelPlacement="parallel"
/>
</div>; </div>;
} else { } else {
orchList = [...obj.data.winningTicketsReceived]; orchList = [...obj.data.winningTicketsReceived];
@ -232,7 +235,10 @@ const WinnerMonth = (obj) => {
labels: { labels: {
fontSize: 10, zIndex: 999 fontSize: 10, zIndex: 999
} }
}} /> }}
labelPosition="centroid"
labelPlacement="parallel"
/>
</div>; </div>;
} }