I am new in QT, I want to build a chart. In the chart, i want to show only line. You can see the picture with is attached. How can i remove this point?1 Thank you.
Asked
Active
Viewed 268 times
-1
-
1Before posting their first question on stackoverflow.com, everyone should take the [tour], read the [help], understand all the requirements for a [mre] and [ask] questions here. Not doing any of this results in a poor quality question almost every time. It then gets downvoted, closed, and then deleted. – Sam Varshavchik Mar 17 '22 at 11:14
-
that blue square is `chart legend` and it is active by default you can hide it. that wasn't point – Parisa.H.R Mar 17 '22 at 11:25
1 Answers
1
you should hide legends.
chart->legend()->hide();
For example :
QChart *chart = new QChart();
chart->addSeries(series);
chart->setTitle("Simple areachart example");
chart->createDefaultAxes();
chart->axes(Qt::Horizontal).first()->setRange(0, 20);
chart->axes(Qt::Vertical).first()->setRange(0, 10);
chart->legend()->hide();
QChartView *chartView = new QChartView(chart);
chartView->setRenderHint(QPainter::Antialiasing);
you can see what happens from this picture:
before after
I use this Qt Example

Parisa.H.R
- 3,303
- 3
- 19
- 38