Bug 487061

Summary: Bar chart width not enough for System Monitor on horizontal panel with multiple bars
Product: [Plasma] plasmashell Reporter: fxzjshm <fxzjshm>
Component: System Monitor widgetsAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ahiemstra, junkblocker, kde, notmart, plasma-bugs-null
Priority: NOR    
Version First Reported In: 6.0.4   
Target Milestone: 1.0   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Comparison of the bar chart

Description fxzjshm 2024-05-15 14:57:08 UTC
Created attachment 169506 [details]
Comparison of the bar chart

SUMMARY
After "Fix linecharts and bar charts for small sizes" (https://invent.kde.org/plasma/libksysguard/-/merge_requests/339), 
width of bar chart is too small for bar charts with multiple bars like "Individual Core Usage" to be shown.

STEPS TO REPRODUCE
1. add a horizontal panel to desktop
2. add a Individual Core Usage to the panel

OBSERVED RESULT
Bars cannot be shown (actually too narrow to show; if there's only 2 bars it can be shown)

EXPECTED RESULT
Usage of all cores are shown

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 22.04
(available in About System)
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.3.0
Qt Version: 6.6.3

ADDITIONAL INFORMATION
For this scenario, I'd suggest revert the minimal width back:
```
diff --git a/faces/facepackages/barchart/contents/ui/CompactRepresentation.qml b/faces/facepackages/barchart/contents/ui/CompactRepresentation.qml
index b7740c43..c847491f 100644
--- a/faces/facepackages/barchart/contents/ui/CompactRepresentation.qml
+++ b/faces/facepackages/barchart/contents/ui/CompactRepresentation.qml
@@ -21,7 +21,7 @@ import org.kde.quickcharts.controls as ChartControls
 
 Faces.SensorFace {
     id: root
-    Layout.minimumWidth: Kirigami.Units.gridUnit
+    Layout.minimumWidth: formFactor == Faces.SensorFace.Horizontal ? Kirigami.Units.gridUnit / 2 * barChart.barCount : Kirigami.Units.gridUnit
     Layout.minimumHeight: Kirigami.Units.gridUnit
 
     contentItem: ColumnLayout {
```
`minimumHeight` may also needs such resizing.
Comment 1 fxzjshm 2024-06-23 15:26:59 UTC
Seems have been fixed by https://invent.kde.org/plasma/libksysguard/-/merge_requests/351 , closing.