Skip to content

Commit 6840664

Browse files
Update LineTimeSerieChart tooltip formatting and add unitRange to PercentageChartExample story
1 parent 908bff1 commit 6840664

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/lib/components/charts/linetimeseries/LineTimeSerieChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const LineTimeSerieChartTooltip = ({
172172

173173
const formattedValue = !Number.isFinite(entry.value)
174174
? '-'
175-
: `${entry.value.toFixed(2)} ${unitLabel}`;
175+
: `${entry.value.toFixed(2)}${unitLabel ? ` ${unitLabel}` : ''}`;
176176

177177
return (
178178
<React.Fragment key={index}>

stories/linetimeseriechart.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ export const PercentageChartExample: Story = {
502502
helpText: 'This is the help text',
503503
yAxisType: 'percentage',
504504
yAxisTitle: '',
505+
unitRange: [{ threshold: 1, label: '%' }],
505506
interval: SAMPLE_FREQUENCY_LAST_TWENTY_FOUR_HOURS,
506507
duration: SAMPLE_DURATION_LAST_TWENTY_FOUR_HOURS,
507508
xAxisFormat: 'date-time',

0 commit comments

Comments
 (0)