QCustomPlot Discussion and Comments

problem with scroll barReturn to overview

Hello, i'm using a horizontal scroll bar to scroll my plot. in some cases, the scroll bar only works good in value=0(scroll bar value) and in other values, the screen is empty of signal. i designed this Experiment on a push button clicked:

    double screen_up=ui->plot_platform->xAxis->range().upper;//=1010000
    double screen_low=ui->plot_platform->xAxis->range().lower;//=10000
    int scroll_max=ui->horizontalScrollBar_2->maximum();//=460
    int scroll_min=ui->horizontalScrollBar_2->minimum();//=0
    int scroll_val=ui->horizontalScrollBar_2->value();//=10
    QVector<double> test0(10000);
    QVector<double> test1(10000);
    for(int i=0;i<10000;i++){

i checked my data. i have valid data in range (10000 - 1010000). what it means that there is data in range and screen is empty? why?

i also add replot to end of the push button slot:

I think there is not enough information to help you.

I would like to see keyMin, keyMax, valueMin, valueMax.
And layer() of graph, axes, axisRect.

i found that at the end of my data, some of keys are not sorted and this is the base of problem. now, how i can reallocate excess data?
i add them in this type:

      QVector<QCPGraphData> add_data(10000);

some time the data is less than 10000 and excess data should be removed. how can i remove excess data without any change in other data?

excuse me!
reallocate => deallocate