diff --git a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h index 2684b194f..c5e6dd91f 100644 --- a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h +++ b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.h @@ -130,7 +130,7 @@ public: virtual ScatterCtrl &Scatter() {return scatter;}; private: - Vector s1,s2, s3; + Vector s1, s2, s3; }; class Tab9 : public WithTab9 { @@ -186,6 +186,7 @@ public: private: Vector s1, s2, s3; + void OnLink(); }; class TabUserEquation : public WithTabUserEquation { @@ -200,6 +201,30 @@ private: UserEquation userEquation; }; +class TabRangePlot : public WithTabRangePlot { +public: + typedef TabRangePlot CLASSNAME; + + void Init(); + virtual ScatterCtrl &Scatter() {return scatter;}; + +private: + Vector > s1; + Vector idsRange; +}; + +class TabBallPlot : public WithTabBallPlot { +public: + typedef TabBallPlot CLASSNAME; + + void Init(); + virtual ScatterCtrl &Scatter() {return scatter;}; + +private: + Vector > s1; + Vector idsBall; +}; + class TabPie : public WithTabPie { public: typedef TabPie CLASSNAME; diff --git a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay index 487eae371..94b1bf766 100644 --- a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay +++ b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.lay @@ -11,23 +11,23 @@ LAYOUT(ScatterCtrl_Demo, 624, 352) END_LAYOUT LAYOUT(Tab1, 428, 296) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Basic Test")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaRightMargin(20).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(2).HSizePosZ(4, 4).VSizePosZ(4, 4)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Basic Test")).SetPlotAreaRightMargin(20).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(2).HSizePosZ(4, 4).VSizePosZ(4, 4)) END_LAYOUT LAYOUT(Tab2, 380, 292) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Functions")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaRightMargin(110).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetGridWidth(2).SetLegendAnchor(2).SetLegendPosX(-107).SetLegendPosY(0).HSizePosZ(16, 12).VSizePosZ(16, 16)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Functions")).SetGridWidth(2).SetPlotAreaRightMargin(110).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(2).SetLegendPosX(-107).SetLegendPosY(0).HSizePosZ(16, 12).VSizePosZ(16, 16)) END_LAYOUT LAYOUT(Tab3, 384, 284) - ITEM(ScatterCtrl, scatter, SetAxisWidth(12).SetTitle(t_("Parametric functions demo")).SetTitleFont(SansSerifZ(14).Bold()).SetTitleColor(White).SetPlotAreaTopMargin(20).SetPlotAreaColor(Color(229, 229, 229)).SetLabelsColor(White).SetAxisColor(Color(28, 212, 0)).SetColor(Color(198, 212, 255)).SetGridColor(Color(28, 127, 0)).SetLegendAnchor(2).HSizePosZ(16, 16).VSizePosZ(16, 16)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Parametric functions demo")).SetTitleColor(White).SetPlotAreaTopMargin(20).SetPlotAreaColor(Color(229, 229, 229)).SetLabelsColor(White).SetAxisColor(Color(28, 212, 0)).SetAxisWidth(12).SetGridColor(Color(28, 127, 0)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(2).SetColor(Color(198, 212, 255)).HSizePosZ(16, 16).VSizePosZ(16, 16)) END_LAYOUT LAYOUT(Tab4, 400, 316) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Temperature Average. X Axis mouse zoom + scroll")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaLeftMargin(40).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(40).SetLabelX(t_("Month")).SetLabelsFont(SansSerifZ(11)).SetLegendAnchor(2).HSizePosZ(16, 16).VSizePosZ(16, 16)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Temperature Average. X Axis mouse zoom + scroll")).SetPlotAreaLeftMargin(40).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(40).SetLabelX(t_("Month")).SetLabelsFont(SansSerifZ(11)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(2).HSizePosZ(16, 16).VSizePosZ(16, 16)) END_LAYOUT LAYOUT(Tab5, 400, 288) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Dynamic")).SetTitleFont(StdFontZ(14).Bold()).SetPlotAreaLeftMargin(40).SetPlotAreaRightMargin(10).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(40).SetLabelX(t_("time")).SetLabelY(t_("Electric circuit performance")).SetLegendAnchor(2).SetLegendPosX(10).SetLegendPosY(10).HSizePosZ(16, 12).VSizePosZ(12, 36)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Dynamic")).SetPlotAreaLeftMargin(40).SetPlotAreaRightMargin(10).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(40).SetLabelX(t_("time")).SetLabelY(t_("Electric circuit performance")).SetTitleFont(StdFontZ(14).Bold()).SetLegendAnchor(2).SetLegendPosX(10).SetLegendPosY(10).HSizePosZ(16, 12).VSizePosZ(12, 36)) ITEM(Button, bStart, SetLabel(t_("Start")).LeftPosZ(16, 42).BottomPosZ(5, 23)) ITEM(Button, bStop, SetLabel(t_("Stop")).LeftPosZ(64, 42).BottomPosZ(5, 23)) ITEM(Button, bReset, SetLabel(t_("Reset")).LeftPosZ(112, 42).BottomPosZ(5, 23)) @@ -38,11 +38,11 @@ LAYOUT(Tab5, 400, 288) END_LAYOUT LAYOUT(Tab6, 400, 280) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Logarithmic Scale")).SetTitleFont(StdFontZ(14).Bold()).SetPlotAreaTopMargin(20).SetLegendAnchor(2).HSizePosZ(12, 12).VSizePosZ(16, 16)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Logarithmic Scale")).SetPlotAreaTopMargin(20).SetTitleFont(StdFontZ(14).Bold()).SetLegendAnchor(2).HSizePosZ(12, 12).VSizePosZ(16, 16)) END_LAYOUT LAYOUT(Tab7, 388, 300) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Operations")).SetTitleFont(MonospaceZ(16).Bold()).SetPlotAreaLeftMargin(45).SetPlotAreaTopMargin(20).SetLabelX(t_("[x]")).SetLabelY(t_("[y]")).SetLegendAnchor(2).HSizePosZ(12, 12).VSizePosZ(12, 36)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Operations")).SetPlotAreaLeftMargin(45).SetPlotAreaTopMargin(20).SetLabelX(t_("[x]")).SetLabelY(t_("[y]")).SetTitleFont(MonospaceZ(16).Bold()).SetLegendAnchor(2).HSizePosZ(12, 12).VSizePosZ(12, 36)) ITEM(Button, bAddSeries, SetLabel(t_("AddSeries")).LeftPosZ(12, 60).BottomPosZ(4, 20)) ITEM(Button, bRemoveLastSeries, SetLabel(t_("RemoveLastSeries")).LeftPosZ(76, 104).BottomPosZ(4, 20)) ITEM(Button, bRemoveFirstSeries, SetLabel(t_("RemoveFirstSeries")).LeftPosZ(184, 100).BottomPosZ(4, 20)) @@ -50,22 +50,22 @@ LAYOUT(Tab7, 388, 300) END_LAYOUT LAYOUT(Tab8, 400, 316) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Temperature & Pressure Averages. X-Y Axis mouse zoom + scroll")).SetTitleFont(SansSerifZ(15).Bold()).SetPlotAreaLeftMargin(40).SetPlotAreaRightMargin(70).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(50).SetLabelX(t_("Month")).SetLabelY(t_("Legend Y")).SetLabelY2(t_("Legend Y2")).SetLabelsFont(SansSerifZ(11)).SetLegendAnchor(2).HSizePosZ(16, 16).VSizePosZ(16, 16)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Temperature & Pressure Averages. X-Y Axis mouse zoom + scroll")).SetPlotAreaLeftMargin(40).SetPlotAreaRightMargin(70).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(50).SetLabelX(t_("Month")).SetLabelY(t_("Legend Y")).SetLabelY2(t_("Legend Y2")).SetLabelsFont(SansSerifZ(11)).SetTitleFont(SansSerifZ(15).Bold()).SetLegendAnchor(2).HSizePosZ(16, 16).VSizePosZ(16, 16)) END_LAYOUT LAYOUT(Tab9, 380, 348) - ITEM(ScatterCtrl, scatter, SetTitle(t_("Big dataset")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(2).HSizePosZ(16, 12).VSizePosZ(16, 76)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Big dataset")).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(2).HSizePosZ(16, 12).VSizePosZ(16, 76)) ITEM(Option, sequentialX, SetLabel(t_("SetSequentialX")).LeftPosZ(112, 92).BottomPosZ(8, 16)) ITEM(Option, fastView, SetLabel(t_("SetFastView")).LeftPosZ(16, 84).BottomPosZ(8, 16)) ITEM(Label, dv___3, SetLabel(t_("It includes two series with 100000 points.\nTo work with Painter it requires SetFastView and SetSequentialX to be true. \nIf not the program could get stuck.")).HSizePosZ(16, 4).BottomPosZ(28, 44)) END_LAYOUT LAYOUT(Tab10, 380, 292) - ITEM(ScatterCtrl, scatter, SetTitle(t_("User graph")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(2).HSizePosZ(16, 12).VSizePosZ(16, 16)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("User graph")).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(2).HSizePosZ(16, 12).VSizePosZ(16, 16)) END_LAYOUT LAYOUT(TabUserEquation, 672, 276) - ITEM(ScatterCtrl, scatter, SetTitle(t_("User equation")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaRightMargin(20).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetLegendAnchor(2).HSizePosZ(4, 4).VSizePosZ(4, 28)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("User equation")).SetPlotAreaRightMargin(20).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(2).HSizePosZ(4, 4).VSizePosZ(4, 28)) ITEM(Label, dv___1, SetLabel(t_("to")).RightPosZ(140, 16).BottomPosZ(3, 21)) ITEM(Label, dv___2, SetLabel(t_("from y =")).RightPosZ(204, 44).BottomPosZ(3, 21)) ITEM(Label, dv___3, SetLabel(t_("User equation y = f(x) =")).LeftPosZ(8, 116).BottomPosZ(3, 21)) @@ -80,7 +80,7 @@ LAYOUT(TabUserEquation, 672, 276) END_LAYOUT LAYOUT(Tab11, 504, 468) - ITEM(ScatterCtrl, scatter, SetAxisWidth(12).SetTitle(t_("Trend Line demo")).SetTitleFont(SansSerifZ(14).Bold()).SetPlotAreaLeftMargin(35).SetPlotAreaTopMargin(20).SetPlotAreaColor(Color(229, 229, 229)).SetLegendAnchor(4).HSizePosZ(8, 8).VSizePosZ(8, 108)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Trend Line demo")).SetPlotAreaLeftMargin(35).SetPlotAreaTopMargin(20).SetPlotAreaColor(Color(229, 229, 229)).SetAxisWidth(12).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(4).HSizePosZ(8, 8).VSizePosZ(8, 108)) ITEM(ArrayCtrl, grid, HSizePosZ(112, 8).BottomPosZ(4, 100)) ITEM(Label, dv___2, SetLabel(t_("Data series:")).LeftPosZ(8, 64).BottomPosZ(55, 21)) ITEM(Label, dv___3, SetLabel(t_("Trend Lines Details:")).LeftPosZ(8, 100).BottomPosZ(83, 21)) @@ -88,13 +88,22 @@ LAYOUT(Tab11, 504, 468) END_LAYOUT 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)) + ITEM(ScatterCtrl, scatter1, SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(1).HSizePosZ(4, 4).TopPosZ(4, 152)) + ITEM(ScatterCtrl, scatter2, SetPlotAreaTopMargin(0).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(1).HSizePosZ(4, 4).TopPosZ(152, 152)) + ITEM(ScatterCtrl, scatter3, SetPlotAreaTopMargin(0).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).SetLegendAnchor(1).HSizePosZ(4, 4).VSizePosZ(300, 4)) + ITEM(Option, link, SetLabel(t_("Link")).RightPosZ(4, 56).TopPosZ(4, 16)) 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)) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Polar Plot")).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).HSizePosZ(4, 4).VSizePosZ(4, 4)) +END_LAYOUT + +LAYOUT(TabRangePlot, 420, 236) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Range Plot")).SetPlotAreaLeftMargin(40).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).HSizePosZ(4, 4).VSizePosZ(4, 4)) +END_LAYOUT + +LAYOUT(TabBallPlot, 420, 236) + ITEM(ScatterCtrl, scatter, SetTitle(t_("Ball Plot")).SetPlotAreaLeftMargin(40).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).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 c4a4ad333..b0c9eb8ce 100644 --- a/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.upp +++ b/examples/ScatterCtrl_Demo/ScatterCtrl_Demo.upp @@ -23,8 +23,10 @@ file tab10.cpp, tab11.cpp, tab12.cpp, - tab14.cpp, - tabPie.cpp, + tab14_UserEquation.cpp, + tab15_RangePlot.cpp, + tab16_BallPlot.cpp, + tab20_Pie.cpp, symbol.iml; mainconfig diff --git a/examples/ScatterCtrl_Demo/main.cpp b/examples/ScatterCtrl_Demo/main.cpp index acbcec802..3ec9024d2 100644 --- a/examples/ScatterCtrl_Demo/main.cpp +++ b/examples/ScatterCtrl_Demo/main.cpp @@ -79,7 +79,7 @@ ScatterCtrl_Demo::ScatterCtrl_Demo() SetMode(); examplesList.WhenSel = THISBACK(OnSel); - examplesList.Select(0, false); + examplesList.SetCursor(13); OnSel(); Sizeable().Zoomable().Icon(MyImages::i1()); diff --git a/examples/ScatterCtrl_Demo/tab1.cpp b/examples/ScatterCtrl_Demo/tab1.cpp index 0ba6ac43e..ce15e523d 100644 --- a/examples/ScatterCtrl_Demo/tab1.cpp +++ b/examples/ScatterCtrl_Demo/tab1.cpp @@ -10,15 +10,15 @@ void Tab1::Init() SizePos(); s1 << Pointf(10, 26) << Pointf(20, 37) << Pointf(30, 31) << Pointf(40, 33) << Pointf(50, 28); - scatter.AddSeries(s1).Legend("Series 1").Opacity(0.3).Fill(); + 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; scatter.AddSeries(s2y, 5, 10, 10).Legend("Series 2").Id(SERIE2).PlotStyle() - .Dash("").MarkColor(Red()).Fill().Opacity(0.5); + .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; - scatter.AddSeries(s3x, s3y, 5).Legend("Series 3"); + scatter.AddSeries(s3x, s3y, 5).Legend("Series 3").MarkBorderColor(); s4y << 14 << 25 << 19 << 21 << 16; s4x << 10 << 20 << 30 << 40 << 50; diff --git a/examples/ScatterCtrl_Demo/tab12.cpp b/examples/ScatterCtrl_Demo/tab12.cpp index a4c4fbe61..5fc464773 100644 --- a/examples/ScatterCtrl_Demo/tab12.cpp +++ b/examples/ScatterCtrl_Demo/tab12.cpp @@ -21,8 +21,23 @@ void Tab12::Init() 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); + scatter2.ShowInfo(); + scatter3.ShowInfo(); + link = true; + OnLink(); + link.WhenAction = THISBACK(OnLink); +} + +void Tab12::OnLink() { + if (link) { + scatter1.SetTitle("Plots are linked together"); + scatter2.LinkedWith(scatter1); + scatter3.LinkedWith(scatter1); + } else { + scatter1.SetTitle("Plots are not linked now"); + scatter2.Unlinked(); + scatter3.Unlinked(); + } } ScatterDemo *Construct12() diff --git a/examples/ScatterCtrl_Demo/tab14_UserEquation.cpp b/examples/ScatterCtrl_Demo/tab14_UserEquation.cpp new file mode 100644 index 000000000..1dc247a5e --- /dev/null +++ b/examples/ScatterCtrl_Demo/tab14_UserEquation.cpp @@ -0,0 +1,44 @@ +#include "ScatterCtrl_Demo.h" + + +void TabUserEquation::Init() +{ + CtrlLayout(*this); + SizePos(); + + equation <<= "25 + 10*sin(0.5*x + 5)"; + fromX <<= 0; + toX <<= 100; + fromY <<= 0; + toY <<= 50; + + update.WhenAction = THISBACK(OnUpdate); + scatter.SetMouseHandling(true, true); + OnUpdate(); +} + +void TabUserEquation::OnUpdate() +{ + if (fromX >= toX || fromY >= toY) { + Exclamation("Wrong limits"); + return; + } + + userEquation.Init("User equation", equation); + + scatter.RemoveAllSeries(); + scatter.AddSeries(userEquation).Legend(userEquation.GetFullName()).NoMark().Stroke(2); + scatter.SetXYMin(fromX, fromY); + scatter.SetRange(toX - fromX, toY - fromY); + scatter.FitToData(true); +} + +ScatterDemo *ConstructUserEquation() +{ + static TabUserEquation tab; + return &tab; +} + +INITBLOCK { + RegisterExample("User equation", ConstructUserEquation, __FILE__); +} diff --git a/examples/ScatterCtrl_Demo/tab15_RangePlot.cpp b/examples/ScatterCtrl_Demo/tab15_RangePlot.cpp new file mode 100644 index 000000000..3691b6aa3 --- /dev/null +++ b/examples/ScatterCtrl_Demo/tab15_RangePlot.cpp @@ -0,0 +1,33 @@ +#include "ScatterCtrl_Demo.h" + + +void TabRangePlot::Init() +{ + CtrlLayout(*this); + SizePos(); + + scatter.SetMouseHandling(true, true).ShowContextMenu(); + + for (double size = 0; size <= 10; size += 2.) { + Vector &data = s1.Add(); + double val = size * 10.; + data << size << val << (val - 10) << (val - 4) << (val + 4) << (val + 10); + } + idsRange << 2 << 3 << 4 << 5; + static Vector idVoid; + scatter.AddSeries(s1, 1, 0, idsRange, idVoid, idVoid).Legend("Time").Units("sec") + .MarkStyle(RangePlot::MIN_AVG_MAX).NoPlot(); + + scatter.SetLabelY("Size"); + scatter.FitToData(true, 0.2); +} + +ScatterDemo *Construct15() +{ + static TabRangePlot tab; + return &tab; +} + +INITBLOCK { + RegisterExample("RangePlot", Construct15, __FILE__); +} \ No newline at end of file diff --git a/examples/ScatterCtrl_Demo/tab16_BallPlot.cpp b/examples/ScatterCtrl_Demo/tab16_BallPlot.cpp new file mode 100644 index 000000000..30a2e7fd3 --- /dev/null +++ b/examples/ScatterCtrl_Demo/tab16_BallPlot.cpp @@ -0,0 +1,32 @@ +#include "ScatterCtrl_Demo.h" + + +void TabBallPlot::Init() +{ + CtrlLayout(*this); + SizePos(); + + scatter.SetMouseHandling(true, true).ShowContextMenu(); + + for (double size = 0; size <= 10; size += 2.) { + Vector &data = s1.Add(); + data << size << 10 + 50*sin(size/M_PI) << size*4 + 4; + } + idsBall << 2; + static Vector idVoid; + scatter.AddSeries(s1, 1, 0, idVoid, idVoid, idsBall).Legend("Importance").MarkStyle() + .NoPlot().MarkColor(Green()).MarkBorderColor(LtRed()).MarkBorderWidth(3); + + scatter.SetLabelY("Size"); + scatter.FitToData(true, 0.2); +} + +ScatterDemo *Construct16() +{ + static TabBallPlot tab; + return &tab; +} + +INITBLOCK { + RegisterExample("BallPlot", Construct16, __FILE__); +} \ No newline at end of file diff --git a/examples/ScatterCtrl_Demo/tab20_Pie.cpp b/examples/ScatterCtrl_Demo/tab20_Pie.cpp new file mode 100644 index 000000000..55ff707fb --- /dev/null +++ b/examples/ScatterCtrl_Demo/tab20_Pie.cpp @@ -0,0 +1,12 @@ +#include "ScatterCtrl_Demo.h" + + +void TabPie::Init() +{ + CtrlLayout(*this); + + chart.ShowPercent(); + chart.AddCategory("Sunny", 8, ::Color(90, 150, 255)); + chart.AddCategory("Cloudy", 4, ::Color(90, 255, 150)); + chart.AddCategory("Rainy", 2, ::Color(250, 150, 90)); +}