diff --git a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h index 076b4d13e..92e199328 100644 --- a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h +++ b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h @@ -29,6 +29,7 @@ public: virtual ScatterCtrl &Scatter() {return scatter;}; private: + Vector sDemoRed1, sDemoRed2,sDemoGreen; Vector s1; double s2y[5]; double s3x[5], s3y[5]; @@ -221,8 +222,12 @@ public: virtual ScatterCtrl &Scatter() {return scatter;}; private: - Vector > s1; + Vector > s1, s2; Vector idsRange; + Vector sdata, smin, smax; + VectorPointf dmin, dmax; + DataReverse rev; + DataAppend app; }; class TabBubblePlot : public WithTabBubblePlot { diff --git a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay index d3d63337f..92e14da28 100644 --- a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay +++ b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay @@ -111,7 +111,7 @@ LAYOUT(TabUserPaint, 428, 296) END_LAYOUT LAYOUT(TabPie, 536, 440) - ITEM(PieCtrl, chart, SetLegendBackColor(Color(229, 229, 229)).SetLegendLeft(20).SetTitle(t_("Average Weather")).SetFrame(ThinInsetFrame()).HSizePosZ(8, 12).VSizePosZ(40, 12)) + ITEM(PieCtrl, chart, SetLegendLeft(20).SetLegendBackColor(Color(229, 229, 229)).SetTitle(t_("Average Weather")).SetFrame(ThinInsetFrame()).HSizePosZ(8, 12).VSizePosZ(40, 12)) ITEM(Label, dv___1, SetLabel(t_(" EXPERIMENTAL")).SetFrame(ThinInsetFrame()).LeftPosZ(8, 84).TopPosZ(8, 24)) END_LAYOUT diff --git a/examples/ScatterCtrl_Demo/main.cpp b/examples/ScatterCtrl_Demo/main.cpp index 75cc97878..9885be449 100644 --- a/examples/ScatterCtrl_Demo/main.cpp +++ b/examples/ScatterCtrl_Demo/main.cpp @@ -51,6 +51,14 @@ ScatterCtrl_Demo::ScatterCtrl_Demo() Add((*(Examples()[i].ctrl())).HSizePosZ(180, 4).VSizePosZ(4, 8)); examplesRects.Add(Examples()[i].ctrl()); } +/* for (int i = 0; i < Examples().GetCount(); ++i) { + if (Examples()[i].name == "User equation") { + TabUserEquation &tab = dynamic_cast(*Examples()[i].ctrl()); + EditString &equation = tab.equation; + equation.SetText("HELLO WORLD"); + } + }*/ + examplesList.Add("Pie chart"); tabPie.Init(); Add(tabPie.HSizePosZ(180, 4).VSizePosZ(4, 8)); diff --git a/examples/ScatterCtrl_Demo/tab15_RangePlot.cpp b/examples/ScatterCtrl_Demo/tab15_RangePlot.cpp index 906383ecf..7de94eb54 100644 --- a/examples/ScatterCtrl_Demo/tab15_RangePlot.cpp +++ b/examples/ScatterCtrl_Demo/tab15_RangePlot.cpp @@ -1,6 +1,5 @@ #include "ScatterCtrl_Demo.h" - void TabRangePlot::Init() { CtrlLayout(*this); @@ -19,7 +18,23 @@ void TabRangePlot::Init() scatter.AddSeries(s1, 0, Null, idVoid, idsRange, idVoid).Legend("Size").Units("m") .MarkStyle(RangePlot::MIN_AVG_MAX); + sdata << Pointf(0, 10) << Pointf(1, 14) << Pointf(2, 20) << Pointf(3, 30) << Pointf(4, 23) << Pointf(5, 25) + << Pointf(6, 3) << Pointf(7, 21) << Pointf(8, 37) << Pointf(9, 32) << Pointf(10, 28); + for (int i = 0; i < sdata.GetCount(); ++i) { + smax << Pointf(sdata[i].x, sdata[i].y + 5 + Random(10)); + smin << Pointf(sdata[i].x, sdata[i].y - 5 - Random(10)); + } + dmin.Init(smin); + rev.Init(dmin); + dmax.Init(smax); + app.Init(dmax, rev); + scatter.AddSeries(app).Legend("Range").Closed(true).Stroke(0).Fill(LtCyan()).Opacity(0.5).NoMark(); + scatter.AddSeries(smax).Legend("Max").Stroke(1, Blue()).NoMark(); + scatter.AddSeries(smin).Legend("Min").Stroke(1, Blue()).NoMark(); + scatter.AddSeries(sdata).Legend("Data").Stroke(4, Blue()).NoMark(); + scatter.SetLabelY("Size").SetLabelX("time [seg]"); + scatter.ShowButtons(); scatter.ZoomToFit(true, true, 0.2); } diff --git a/examples/ScatterCtrl_Demo/tab1_Basic.cpp b/examples/ScatterCtrl_Demo/tab1_Basic.cpp index 3b4b9b5ca..aee857f6f 100644 --- a/examples/ScatterCtrl_Demo/tab1_Basic.cpp +++ b/examples/ScatterCtrl_Demo/tab1_Basic.cpp @@ -9,7 +9,7 @@ void Tab1_Basic::Init() CtrlLayout(*this); SizePos(); - s1 << Pointf(10, 26) << Pointf(20, 37) << Pointf(30, 31) << Pointf(40, 33) << Pointf(50, 28); + s1 << Pointf(12, 26) << Pointf(20, 37) << Pointf(30, 31) << Pointf(40, 33) << Pointf(50, 28); scatter.AddSeries(s1).Legend("Series 1").Opacity(0.3).Fill().MarkBorderColor(); s2y[0] = 22; s2y[1] = 33; s2y[2] = 27; s2y[3] = 29; s2y[4] = 24; @@ -17,7 +17,7 @@ void Tab1_Basic::Init() .Dash("").MarkColor(Red()).Fill().Opacity(0.5).MarkBorderColor(); s3y[0] = 18; s3y[1] = 29; s3y[2] = 23; s3y[3] = 25; s3y[4] = 20; - s3x[0] = 10; s3x[1] = 20; s3x[2] = 30; s3x[3] = 40; s3x[4] = 50; + s3x[0] = 8; s3x[1] = 20; s3x[2] = 30; s3x[3] = 40; s3x[4] = 50; scatter.AddSeries(s3x, s3y, 5).Legend("Series 3").MarkBorderColor(); s4y << 14 << 25 << 19 << 21 << 16; @@ -30,7 +30,7 @@ void Tab1_Basic::Init() s5.Add(40, 16); s5.Add(50, 12); int barWidth = 4; - scatter.AddSeries(s5).Legend("Series 5").PlotStyle(barWidth).Dash("").NoMark().Fill(); + scatter.AddSeries(s5).Legend("Series 5").PlotStyle().BarWidth(barWidth).Dash("").NoMark().Fill(); scatter.SetRange(60, 50).SetMajorUnits(10, 10); scatter.ShowInfo().ShowContextMenu().ShowPropertiesDlg().ShowProcessDlg().SetPopText("h", "v", "v2").SetMouseHandling(true, true); diff --git a/examples/ScatterCtrl_Demo/tab5_Dynamic.cpp b/examples/ScatterCtrl_Demo/tab5_Dynamic.cpp index 3ccc63029..d2a440d40 100644 --- a/examples/ScatterCtrl_Demo/tab5_Dynamic.cpp +++ b/examples/ScatterCtrl_Demo/tab5_Dynamic.cpp @@ -9,6 +9,7 @@ void Tab5_Dynamic::Init() scatter.SetRange(10, 100); scatter.AddSeries(s1).Legend("U-t").Units("V", "s").NoMark(); scatter.AddSeries(s2).Legend("I-t").Units("A", "s").NoMark(); + scatter.SetFastViewX(true).SetSequentialXAll(true); bStart <<=(THISBACK(Start)); bStop <<=(THISBACK(Stop)); bReset <<=(THISBACK(Reset)); diff --git a/examples/ScatterCtrl_Demo/tab8_Secondary.cpp b/examples/ScatterCtrl_Demo/tab8_Secondary.cpp index 178bcce11..69221ec98 100644 --- a/examples/ScatterCtrl_Demo/tab8_Secondary.cpp +++ b/examples/ScatterCtrl_Demo/tab8_Secondary.cpp @@ -11,7 +11,7 @@ void Tab8_Secondary::Init() s3 <(barWidth).NoMark().Stroke(2, Gray()).Dash(LINE_SOLID).Fill(LtGray()); + scatter.AddSeries(s3).Legend("Speed").Units("km/h").PlotStyle().BarWidth(barWidth).NoMark().Stroke(2, Gray()).Dash(LINE_SOLID).Fill(LtGray()); s1<();