GRAPH YT Zoom

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • GRAPH YT Zoom

    I want to make zoom function on YT-Graph on Y Axis and also on X-Axis.
    Is there any example how to do this ?
    My data source is array of temperatures with 7200 floating point elements.

    I'm trying with rewriting complete graph data objects with GRAPH_DATA_YT_AddValue(), but it works very slow.
    Can you suggest me how to fastest update all complete data objects with new rescaled values ?

    //*************************************************
    //Part of my code
    #define GPH_MEM_RECORDS 7200
    #define Y_SCALE_MIN 15.0
    #define Y_SCALE_MAX 25.0
    #define GRAPH_PIXELS_Y 200
    #define Y_SCALE_FACTOR ((float)(Y_SCALE_MAX-(Y_SCALE_MIN))/GRAPH_PIXELS_Y)

    float gph_mem_temp[GPH_MEM_RECORDS];
    int i;

    //Set new scale
    GRAPH_SCALE_SetFactor(_hScaleV , Y_SCALE_FACTOR);
    GRAPH_SCALE_SetOff(_hScaleV , -(Y_SCALE_MIN / Y_SCALE_FACTOR) + VSCROLL_OFFY);

    //replacing old data with new rescaled data
    for(i = 0; i < GPH_MEM_RECORDS; i++)
    {
    GRAPH_DATA_YT_AddValue(_ahData[0],gph_mem_temp / Y_SCALE_FACTOR );
    }

    //*************************************************
    X-zoom magnifying is made with data skipping. I read every second source data and add it to graph.

    Any suggestions or code examples appreciated.
  • Hello ToneL,

    Currently there is no possibility to rescale the x-axis without having to rewrite the necessary elements. We intend to make the GRAPH widget allow fast scaling of the x-axis, but this is actually not fixed in the schedule yet, so I am afraid I can not tell you when it is going to be available.

    If you have any further questions, please let me know.

    Best regards,
    Adrian