XY_CURVES_GRAPH
This widget displays a graph using two curves: one for the x axis and one for the y axis. the result is a parametric curve displayed as (x,y)=f(t).
Attributes brief detailed show all inherited
See Attributes Common to Curve Viewers, prefixed with 'x_curve.' for the x axis, and prefixed by 'y_curve.' for the y axis curve - except for the curve identifiers: x_curve_id and y_curve_id.
Examples
Here's an example of two curves displayed on XY_CURVES_GRAPH:
- <!-- formula curve -->
- <FORMULA_CURVE id="formula_curve_demo" x_min="-1.2" x_max="1.2" x_default="0" y_default="0" y_max="0" y_min="-1" formula="-tanh(x)*x" />
- <!-- curve from param over time -->
- <CURVE_FROM_PARAM_OVER_TIME id="time_curve_demo" param_id="demo_param" duration_ms="10000" refresh_time_ms="10"/>
- <PARAM id="demo_param" min="-10" max="10" default="0" />
- <!-- demo logic to create changes of param in time -->
- <SCRIPT script="double demo_val = 0;" />
- <TIMER id="forever_timer" refresh_time_ms="5" />
- <ACTION_TRIGGER event_id="forever_timer.elapsed"
- script="
- demo_param = cos(demo_val)*7;
- demo_val+=.01;
- " requires="demo_param" />
- <!-- show the curves -->
- <TEXT value="x_curve: -tanh(x)*x" />
- <CURVE_GRAPH curve_id="formula_curve_demo" width="500" height="100" color="#0000DD" graph_style="stroke" opacity="1" line_width="2" />
- <TEXT value="y_curve: cos(time)" />
- <CURVE_GRAPH curve_id="time_curve_demo" width="500" height="100" color="#00DD00" graph_style="stroke" opacity="1" line_width="2" />
- <TEXT value="resulting xy curve" />
- <XY_CURVES_GRAPH x_curve_id="formula_curve_demo" y_curve_id="time_curve_demo" width="500" height="100" color="#990000" graph_style="dots" opacity="1" line_width="3" positions_count="256" />

If we change formula in the first curve to simply "x", the resulting XY_CURVE will follow (duplicate) the y_curve:
- <!-- formula curve -->
- <FORMULA_CURVE id="formula_curve_demo" x_min="0" x_max="1" x_default="0" y_default="0" y_max="1" y_min="0" formula="x" />

Related elements
Also see FORMULA_CURVE, CURVE_FROM_PARAM_OVER_TIME, CURVE_GRAPH, GRID, RULER, CANVAS.
Comments
Please, authorize to view and post comments.