Multiline labels or word wrap for BarCategoryAxis labels
-
wrote on 1 Mar 2022, 18:53 last edited by
I need to display a bar chart with QML. Everything works fine, but my categories labels are elided and not readable as in the image below
Is there a way to force showing full, not elided text for them? Or maybe enable word wrapping, or making labels multi-line. I have tried to put '\n' character inside label text but this does not work.
My code below
import QtQuick 2.0 import QtCharts 2.0 ChartView { width: 380 height:200 margins {top: 0; bottom: 0; left: 0; right: 0} backgroundColor: "#eeeeec" legend.alignment: Qt.AlignRight antialiasing: true ValueAxis{ id: valueAxisY min: 0 max: 100 } BarSeries { id: mySeries axisY: valueAxisY axisX: BarCategoryAxis {categories: ["Productivity", "Land cover", "Soil organic carbon"] } BarSet { label: "Degraded"; values: [15, 30, 22] } BarSet { label: "Improved"; values: [4, 21, 50] } BarSet { label: "Stable"; values: [31, 5, 67] } } }
-
wrote on 2 Mar 2022, 01:20 last edited by Markkyboy 3 Feb 2022, 01:21
-
wrote on 16 Mar 2022, 15:34 last edited byThis post is deleted!