Important: Please read the Qt Code of Conduct -

QtChart, is this possible ...

  • Hello,
    I am looking for a way to integrate graphs (curve plots) in my program. I am not sure, if the QtChars will have all feature I need or if I must look for an other lib.
    This chapter of the documetation ist not clear for me:

    Multiple axes can be defined for one chart. The axes can be placed down, up, left, or right of the chart. Further, the axes can be of different types. However, mixing axis types that would result in different domains is not supported, such as specifying QValueAxis and QLogValueAxis on the same orientation.

    What does it mean "different domains" ? Is is it possible to show 2 line plots in one chartview, where both lines are connected to the same horizontal axis, but have different vertical axes (on at left and one at right side) with different scale.

    Because you add a series to the whole chart and not to two axes its seem that it is not possible - or ?


    Is something like the following possible:

    series->setAxes(horizAxis, vertAxis)

    In this context, is it possible to make, so to speek, "subcharts". Means that I can place custom axes at any place of the chart.

    0    .        100   0    ....... 10  

    Has anybody experiences with it.

  • Lifetime Qt Champion

    I dont know if its possible to have sub chars like that.
    However, i think "different domains" means types of axises that have different coordinate system/ calculation/scale.
    Moreover, i think void QChart::addAxis(QAbstractAxis *axis, Qt::Alignment alignment)
    wont allow stacking them going right. However, not actually tried it so that would be the
    first i would do.
    Note that createDefaultAxes deletes any custom ones you already set so have that in mind.

    How many sub charts to you plan to have?

  • Hello @mrjj ,

    How many subchars ? Hm, dont know. Dynamic ... five ....

    Ok subcharts are not possible (resp. directly - maybe one can subclass and overwrite something).
    or stacking multiple QCharts with, one axis in every chart with same configuration, is possible.....

    Nevertheless, my first simpler question is not clear for me. Is it possible to mix axes with one orientation but with different range (same coordinate type). For example a Axis1 [0,10] left and a Axis 2 [0,100] right. So that a seriespoint (0, 10) connetect to left axis and a series point (0, 100) connected to right axis are both shown on the top of the chart. I hope you understand my roundabout explanation.

    I cannot test it because I have no commercial version, yet.

    Bye Andreas

  • Lifetime Qt Champion

    @Andy314 said in QtChart, is this possible ...:

    I cannot test it because I have no commercial version, yet.

    It's GPL so why can't you test it?

Log in to reply