Skip to content

Fixes #39070 - Update AreaChart to PatternFly5#10803

Open
tlabaj wants to merge 1 commit intotheforeman:developfrom
tlabaj:areachart
Open

Fixes #39070 - Update AreaChart to PatternFly5#10803
tlabaj wants to merge 1 commit intotheforeman:developfrom
tlabaj:areachart

Conversation

@tlabaj
Copy link
Contributor

@tlabaj tlabaj commented Dec 17, 2025

Fixes: #39070

This PR updates the Area Chart to use PF5 components.

image

@github-actions github-actions bot added the UI label Dec 17, 2025
@tlabaj tlabaj changed the title WIP: Update Area chart to PF5 Fixes #39070 - Update AreaChart to PatternFly5 Feb 10, 2026
@tlabaj tlabaj marked this pull request as ready for review February 10, 2026 15:34
@tlabaj tlabaj force-pushed the areachart branch 3 times, most recently from 7395e53 to f0cc83c Compare February 10, 2026 16:15
Copy link
Contributor

@kmalyjur kmalyjur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaving an initial review, I might comment more tomorrow.


return (
<div style={{ height: chartHeight, width: chartWidth || '100%' }}>
<Chart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the chart fill the entire width of the card?

legendData={legendData}
legendOrientation="horizontal"
legendPosition="bottom"
legendComponent={<ChartLegend />}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old chart has clickable legend text, it would be nice to have it in the new one, too.

Comment on lines +151 to +153
<ChartAxis
tickFormat={t => {
if (config === 'timeseries' && t instanceof Date) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config === 'timeseries' can be removed since the data transformation always creates Date objects anyway.

Suggested change
<ChartAxis
tickFormat={t => {
if (config === 'timeseries' && t instanceof Date) {
<ChartAxis
tickFormat={t => {
if (t instanceof Date) {

expect(chartWrapper).toHaveStyle({ height: '300px', width: '500px' });
});

it('renders with onclick callback', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test checks if the chart renders, but it does not verify if the callback actually triggers when clicked.

Copy link
Contributor

@kmalyjur kmalyjur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how I see before and after:
Image
Image

Comment on lines +60 to +67
const handleClick = useMemo(
() => (event, datum) => {
if (onclick && datum && datum.name) {
onclick({ id: datum.name });
}
},
[onclick]
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function is broken or not called.

height={chartHeight}
width={chartWidth}
padding={padding}
themeColor={ChartThemeColor.orange}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could I please ask why orange was chosen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old chart was orange. I can change it to just be the default.

}

const timestamps = timeColumn.slice(1);
const dates = timestamps.map(epochSecs => new Date(epochSecs * 1000));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The axis shows raw numbers (like "17709"). There could be a check if the backend is already sending milliseconds, and if so, it shouldn't use * 1000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments