last category is truncated in a qcategory axis
Unsolved
General and Desktop
-
Hi,
Which version of Qt ?
On which OS ?
Can you provide a minimal compilable example that shows this behaviour ? -
Hi, Thanks for the reply.
Using QT ver-- 5.15.2
Seeing the issue in MAC OSX .
here is a simple code to reproduce the issue:QLineSeries *series = new QLineSeries(); series->append(0, 6); series->append(2, 4); series->append(3, 8); series->append(7, 4); series->append(10, 5); *series << QPointF(11, 1) << QPointF(13, 3) << QPointF(17, 6) << QPointF(18, 3) << QPointF(20, 2); QValueAxis *axisY = new QValueAxis(); axisY->setTickCount(6); axisY->setRange(1, 8); QFont font; font.setPointSize(10); axisY->setTitleFont(font); QCategoryAxis *axisX = new QCategoryAxis; axisX->setMin(0); axisX->setMax(20); axisX->setLabelsPosition(QCategoryAxis::AxisLabelsPositionOnValue); axisX->append("test1",0); axisX->append("test2",7); axisX->append("tes looong string",20); QChart *chart = new QChart(); chart->legend()->hide(); chart->addSeries(series); chart->addAxis(axisY, Qt::AlignLeft); chart->addAxis(axisX, Qt::AlignBottom); chart->setTitle("Simple line chart example"); QChartView *chartView = new QChartView(chart); chartView->setRenderHint(QPainter::Antialiasing); QMainWindow window; window.setCentralWidget(chartView); window.resize(400, 300); window.show();
-
Please next time add the main part as well as include.
From the looks of it the last category is not properly elided.
You should check the bug report system to see if it's something known.