Skip to content

Commit

Permalink
Show label on data with one value
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Nov 22, 2023
1 parent c546960 commit 467ea0e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions frontend/src/scenes/insights/views/LineGraph/PieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,8 @@ export function PieChart({
},
display: (context) => {
const percentage = getPercentageForDataPoint(context)
return (showValueOnSeries !== false || // show if true or unset
showLabelOnSeries) &&
context.dataset.data.length > 1 &&
percentage > 5
? 'auto'
: false
const showValueForSeries = showValueOnSeries !== false && context.dataset.data.length > 1 // show if true or unset
return (showValueForSeries || showLabelOnSeries) && percentage > 5 ? 'auto' : false
},
padding: (context) => {
// in order to make numbers below 10 look circular we need a little padding
Expand Down

0 comments on commit 467ea0e

Please sign in to comment.