diff --git a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h index 8d29b6aa0..a2e86407f 100644 --- a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h +++ b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h @@ -177,10 +177,10 @@ public: typedef Tab12 CLASSNAME; virtual void Init(); - virtual ScatterCtrl &Scatter() {return scatter;}; + virtual ScatterCtrl &Scatter() {return scatter1;}; private: - Vector s1; + Vector s1, s2, s3; }; class TabPie : public WithTabPie { diff --git a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay index 923ab3ac6..d5ba10c9d 100644 --- a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay +++ b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay @@ -70,8 +70,14 @@ LAYOUT(Tab11, 504, 468) ITEM(Label, dv___2, SetLabel(t_("Trend Lines Details:")).LeftPosZ(8, 100).BottomPosZ(83, 21)) END_LAYOUT -LAYOUT(Tab12, 400, 260) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Polar Plot")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetPlotAreaColor(LtGray).SetLabelsFont(StdFontZ(11)).HSizePosZ(4, 4).VSizePosZ(4, 4)) +LAYOUT(Tab12, 456, 464) + ITEM(ScatterCtrl, scatter1, SetTitle(t_("All plots are linked together")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(1).HSizePosZ(4, 4).TopPosZ(4, 152)) + ITEM(ScatterCtrl, scatter2, SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(0).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(1).HSizePosZ(4, 4).TopPosZ(152, 152)) + ITEM(ScatterCtrl, scatter3, SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(0).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(1).HSizePosZ(4, 4).VSizePosZ(300, 4)) +END_LAYOUT + +LAYOUT(Tab13, 420, 236) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Polar Plot")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).HSizePosZ(4, 4).VSizePosZ(4, 4)) END_LAYOUT LAYOUT(TabPie, 536, 440) diff --git a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.upp b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.upp index a6aafe336..cc9a4a848 100644 --- a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.upp +++ b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.upp @@ -22,6 +22,7 @@ file tab9.cpp, tab10.cpp, tab11.cpp, + tab12.cpp, tabPie.cpp, symbol.iml; diff --git a/examples/ScatterCtrl_Demo/tab12.cpp b/examples/ScatterCtrl_Demo/tab12.cpp index 163854fad..246e37fbc 100644 --- a/examples/ScatterCtrl_Demo/tab12.cpp +++ b/examples/ScatterCtrl_Demo/tab12.cpp @@ -1,15 +1,27 @@ #include "ScatterCtrl_Demo.h" + void Tab12::Init() { CtrlLayout(*this); HSizePos().VSizePos(); - - s1 << Pointf(50, 10) << Pointf(100, 20) << Pointf(150, 30) << Pointf(200, 20) << Pointf(250, 10); - scatter.AddSeries(s1).Legend("Series 1").Fill(); - - scatter.SetXYMin(50, 0).SetRange(200, 40).SetMajorUnits(50, 10).SetPolar(); - scatter.ShowInfo().ShowContextMenu().ShowPropertiesDlg().SetPopText("h", "v", "v2").SetMouseHandling(true, true); + scatter1.SetRange(1000, 40).SetXYMin(0, -20); + scatter1.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2); + scatter2.SetRange(1000, 40).SetXYMin(0, -20); + scatter2.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2); + scatter3.SetRange(1000, 40).SetXYMin(0, -20); + scatter3.SetMouseHandling(true).SetMaxRange(5000).SetMinRange(2); + for (int t = 0; t < 1000; ++t) { + s1 << Pointf(t, 20*sin(6*M_PI*t/500)); + s2 << Pointf(t, 20*sin(6*1.1*M_PI*t/500)); + s3 << Pointf(t, 20*sin(6*1.2*M_PI*t/500)); + } + scatter1.AddSeries(s1).Legend("Series 1").NoMark().Stroke(2, LtRed()); + scatter2.AddSeries(s2).Legend("Series 2").NoMark().Stroke(2, LtBlue()); + scatter3.AddSeries(s3).Legend("Series 3").NoMark().Stroke(2, LtGreen()); + scatter1.ShowInfo(); + scatter2.ShowInfo().LinkedWith(scatter1); + scatter3.ShowInfo().LinkedWith(scatter2); } ScatterDemo *Construct12() @@ -19,5 +31,5 @@ ScatterDemo *Construct12() } INITBLOCK { - RegisterExample("Polar plot", Construct12, __FILE__); + RegisterExample("Linked controls", Construct12, __FILE__); } diff --git a/examples/ScatterCtrl_Demo/tab13.cpp b/examples/ScatterCtrl_Demo/tab13.cpp new file mode 100644 index 000000000..163854fad --- /dev/null +++ b/examples/ScatterCtrl_Demo/tab13.cpp @@ -0,0 +1,23 @@ +#include "ScatterCtrl_Demo.h" + +void Tab12::Init() +{ + CtrlLayout(*this); + HSizePos().VSizePos(); + + s1 << Pointf(50, 10) << Pointf(100, 20) << Pointf(150, 30) << Pointf(200, 20) << Pointf(250, 10); + scatter.AddSeries(s1).Legend("Series 1").Fill(); + + scatter.SetXYMin(50, 0).SetRange(200, 40).SetMajorUnits(50, 10).SetPolar(); + scatter.ShowInfo().ShowContextMenu().ShowPropertiesDlg().SetPopText("h", "v", "v2").SetMouseHandling(true, true); +} + +ScatterDemo *Construct12() +{ + static Tab12 tab; + return &tab; +} + +INITBLOCK { + RegisterExample("Polar plot", Construct12, __FILE__); +}