diff options
| author | Grissiom <[email protected]> | 2013-02-01 10:27:10 +0800 |
|---|---|---|
| committer | Grissiom <[email protected]> | 2013-02-01 10:27:10 +0800 |
| commit | f06c70feed0941b5bceedcecf89e9aa22034aca8 (patch) | |
| tree | 89fd3a989b4d88fc72b39eaad6567de3a3d23874 /examples/gui/demo_plot.c | |
| parent | 4f02e67bef7eacee5102d7730356663d9c889e15 (diff) | |
sync with rtgui-0.6
Diffstat (limited to 'examples/gui/demo_plot.c')
| -rw-r--r-- | examples/gui/demo_plot.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/gui/demo_plot.c b/examples/gui/demo_plot.c index fa524aefa7..14595cb1e9 100644 --- a/examples/gui/demo_plot.c +++ b/examples/gui/demo_plot.c @@ -42,7 +42,7 @@ struct rtgui_container* demo_plot(void) curve1->min_x = 0; curve1->max_x = sizeof(sin_ydata)/sizeof(sin_ydata[0]); curve1->min_y = -100; - curve1->min_y = 100; + curve1->max_y = 100; curve1->color = red; rtgui_mv_model_add_view(RTGUI_MV_MODEL(curve1), RTGUI_MV_VIEW(plot)); @@ -51,22 +51,25 @@ struct rtgui_container* demo_plot(void) RTGUI_MV_MODEL(curve2)->length = sizeof(cos_ydata)/sizeof(cos_ydata[0]); curve2->min_x = 0; curve2->max_x = sizeof(cos_ydata)/sizeof(cos_ydata[0]); - curve1->min_y = -50; - curve1->min_y = 50; + curve2->min_y = -50; + curve2->max_y = 50; curve2->color = blue; rtgui_mv_model_add_view(RTGUI_MV_MODEL(curve2), RTGUI_MV_VIEW(plot)); curve3 = rtgui_plot_curve_create(); rtgui_plot_curve_set_x(curve3, cos_ydata); rtgui_plot_curve_set_y(curve3, sin_ydata); + curve3->min_x = -50; + curve3->max_x = 50; + curve3->min_y = -100; + curve3->max_y = 100; RTGUI_MV_MODEL(curve3)->length = sizeof(sin_ydata)/sizeof(sin_ydata[0]); curve3->color = black; rtgui_mv_model_add_view(RTGUI_MV_MODEL(curve3), RTGUI_MV_VIEW(plot)); rtgui_widget_get_rect(RTGUI_WIDGET(cnt), &rect); rtgui_widget_set_rect(RTGUI_WIDGET(plot), &rect); - rtgui_plot_set_base(plot, - -rtgui_rect_width(rect)/3, rtgui_rect_height(rect)/2); + rtgui_plot_set_base(plot, -100, -300); rtgui_container_add_child(cnt, RTGUI_WIDGET(plot)); |
