Skip to content

Commit

Permalink
Fix pie chart labels
Browse files Browse the repository at this point in the history
  • Loading branch information
jmattheis committed Dec 7, 2019
1 parent 816728f commit 3b3c478
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ui/src/dashboard/Entry/DashboardPieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export const DashboardPieChart: React.FC<DashboardPieChartProps> = ({entries}) =
<Pie
isAnimationActive={false}
dataKey="timeSpendInSeconds"
nameKey={(entry) => entry.stringValue}
nameKey={(entry) => {
// tslint:disable-next-line:no-any
return (entry.key + ':' + entry.value) as any;
}}
data={entries}
labelLine={false}
fill="#8884d8"
Expand All @@ -39,7 +42,7 @@ const CustomTooltip = ({active, payload}: TooltipProps) => {
return (
<Paper style={{padding: 10}} elevation={4}>
<Typography>
{first.name}: {prettyMs(first.payload.timeSpendInSeconds * 1000)}
{first.payload.key}:{first.payload.value}: {prettyMs(first.payload.timeSpendInSeconds * 1000)}
</Typography>
</Paper>
);
Expand Down

0 comments on commit 3b3c478

Please sign in to comment.