QChart in UI?



  • Hello!!
    I have a problem with QChart. I want to put a graph in some place of Form (UI) but i don't know how!!
    I sow some examples but in all the case they are write without UI Form...

    Thank you!!!
    Al


  • Qt Champions 2016

    @Alfacu

    Hi
    There are no visual Charts to place in ui file BUT you can use promotion to fake it.
    https://forum.qt.io/topic/68370/qt-charts-and-data-visualization-widgets



  • There are no QChart component in UI file, so I recommend you using C++ or QML to display a QChart. But if you want to use the UI Design to visually design the interface, you can try:

    1.place a layout(for example verticalLayout) in the UI

    2.creat a QChartView to contain the QChart(for example, QChartView *chartView = new QChartView(chart))

    3.let the QChartView display in the layout(for example, ui->verticalLayout->addWidget(chartView))

    finished


Log in to reply