Search code examples
qtgraphqcustomplot

what is the difference between QCPFinancial and QCPGraph?


I have a realtime and big(> milions point) graph. Which class should i use: QCPGraph or QCPFinancial?
What are the advantages and disadvantages of each?


Solution

  • They are two different types of graphs. I don't think there is an advantage of one over the other. It depends on what you want to represent in your graph.

    QCPFinancial:

    A plottable representing a financial stock chart.
    This plottable represents time series data binned to certain intervals, mainly used for stock charts. The two common representations OHLC (Open-High-Low-Close) bars and Candlesticks can be set via setChartStyle.

    enter image description here

    QCPGraph:

    A plottable representing a graph in a plot.
    Graphs are used to display single-valued data. Single-valued means that there should only be one data point per unique key coordinate. In other words, the graph can't have loops. If you do want to plot non-single-valued curves, rather use the QCPCurve plottable.

    enter image description here

    See also this example for a simple QCPGraph.
    Or this example for QCPFinancial.