Solved How to disable labels elide in CategoryAxis in Qml Charts
-
How to avoid eliding labels in CategoryAxis, when they are long? I want to show them fully.
-
I think we can change the width for every category name freely
-
@lockheed
There seems to be no direct method in QML for this, nor in C++.There is a
sizeHint()
method for the classChartCategoryAxisX
which seems to determine this eliding behavior, but I have no idea how to access that internal class.Otherwise, there is always
QCustomPlot
which is easier to hack and which already seems to do what you want:
Just to test it, I used the following example:
https://www.qcustomplot.com/index.php/demos/barchartdemo with extra long labels:Up to you then to e.g. wrap it inside a custom QML type.
-
@Yohit-Kumar Could you pleas provide a code snippet? Simple changing category name width could be easiest way, but I don't know how to do this.
@Diracsbracket QCustomPlot do the job. Thanks!