387 views
in GUI Development by
Hi,

I want to plot graph for the same I'm using  stroke path  .I need to auto scale the graph depending upon the min max range of parameter placed on Y-axis

 for eg if I'm plotting a graph of temp vs pressure with temp on Y axis. so if we change the unit from Celsius to Fahrenheit the Y axis should auto scale to accommodate the max value on Y Axis

I want the origin for Y-axis to be moved at min value of parameter placed on Y-axis(say 50).

Gone through Scale(),Translate() ,Begin() API but not able to achieve the same

please guide me

Regards

Kunal

1 Answer

0 votes
by

Hello Kunal,

the Stroked Path view displays a curve based on coordinates stored in the associated Path Data object. When you want the curve to be scaled, you have to reload the Path data object with accordingly recalculated coordinates. This can be done 'manually', means when the Min-MAX range changes, you retrieve again the original data values, multiply them by the desired scaling factor and store the results in the Path Data object. The contents of the Path Data object can be modified as explained Evaluate and modify the coordinates stored in the Path Data object.

The above approach expects that you maintain the original (unscaled) data outside of the Path Data object. Another approach would be to use two (2) Path Data objects. In this case, the first Path Data object stores the original coordinates (unscaled). The second Path Data object is intended to store the scaled coordinates. The Stroked Path view is consequently connected with the second Path Data object. Each time, when the scaling changes, you copy the content of the first Path Data to the second Path Data object. Before you do this, you configure the second Path Data object with its method Scale() to apply the desired scaling on the copied data. See also the sections:

Apply 2D transformations during the path creation

Store data in a sub-path

I hope it helps you further

Best regards

Paul Banach

by
Hi,

Thanks for the response I'll go through the content mentioned above

Regards

Kunal

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...