Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Line Chart axis fixed range problem

Line Chart axis fixed range problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 191 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bossman48
    wrote on last edited by
    #1

    Hi all,
    i want to build a line chart with using qchart. But I have a problem. i draw paint images for understand clearly. You can see before and after images. I want to build a this type line chart. How can i build a chart like images? Do i use any wrong
    beforeAfter1.png
    beforeAfter2.png

    I am working on this code which is declared in below.

    Code:
    void MainWindow::ecgLineChart(QFrame *horizontalFrame){

    // set pen for series
    QPen pen(QRgb(0x00aa00));
    pen.setWidth(2);
    
    //try some example datas with edges
    QLineSeries *series = new QLineSeries();
    
    //for flow line chart right to left
    series->setPen(pen);
    series->append(0,1);
    series->append(-1,4);
    series->append(-2,5);
    series->append(-3,2);
    series->append(-4,2);
    /*not working for us right now
    
    //create chart with attributes
    QChart *chart = new QChart();
    chart->createDefaultAxes();
    chart->addSeries(series);
    
    chart->setBackgroundBrush(Qt::black);
    chart->layout()->setContentsMargins(0, 0, 0, 0);
    chart->setMargins(QMargins(0, 0, 0, 0));
    chart->setBackgroundRoundness(0);
    chart->setMaximumSize(810,100);
    chart->setMinimumSize(810,100);
    chart->setPreferredSize(810,100);
    chart->legend()->hide();
    
    //create chartview with some attributes
    QChartView *chartview = new QChartView(chart);
    chartview->setRenderHint(QPainter::Antialiasing);
    chartview->setParent(horizontalFrame);
    chartview->setContentsMargins(0,0,0,0);}
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved