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.
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.