getting the coordinate value of points in Qchartview
Unsolved
General and Desktop
-
hello
how to get the values of x and y in Qt chartview when i move the mouse on the pointhere is the code
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); series = new QScatterSeries(); series->append(0,0); series->append(1,3); series->append(3,4); series->append(5,7); chart = new QChart(); chart->addSeries(series); chart->setTitle("chart"); chart->createDefaultAxes(); chart->legend()->hide(); chart->legend()->setAlignment(Qt::AlignTop); chartview = new QChartView(chart); chartview->setRenderHint(QPainter::Antialiasing); //chartview->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); chartview->setParent(this); chartview->setRubberBand(QChartView::RectangleRubberBand); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButton_clicked() { chart->zoomIn(); } void MainWindow::on_pushButton_2_clicked() { chart->zoomOut(); } void MainWindow::on_pushButton_3_clicked() { chart->zoomReset(); }
please suggest a way to do this thanks in advance