Home » Community » Newbie corner » (SOLVED) ScatterCtrl, 2 questions.
(SOLVED) ScatterCtrl, 2 questions. [message #40596] |
Tue, 20 August 2013 12:26  |
rxantos
Messages: 73 Registered: October 2011
|
Member |
|
|
Sorry for the big image. But is easier for me to explain.

The code I use for the example
#include <ScatterCtrl/ScatterCtrl.h>
using namespace Upp;
#define LAYOUTFILE <TestScatter/TestScatter.lay>
#include <CtrlCore/lay.h>
class TestScatter : public WithTestScatterLayout<TopWindow> {
public:
enum {
NPOINTS = 1000,
};
typedef TestScatter CLASSNAME;
Vector<Pointf> points;
TestScatter();
};
TestScatter::TestScatter()
{
int x,y,yMax = 0;
points.SetCount(NPOINTS);
Pointf * pv = points.Begin();
for(x = 0; x < NPOINTS; x++, pv++) {
pv->x = (double)x;
y = rand();
if(yMax < y) {
yMax = y;
}
pv->y = (double)(y);
}
sv.AddSeries(points).Legend("Y").Opacity(0.3).NoMark().Stroke(1);
sv.SetFastViewX().SetSequentialX().SetDrawXReticle().SetDrawYReticle().SetSequentialXAll();
sv.ShowInfo().ShowContextMenu().SetMouseHandling().SetMaxZoom(1000).SetMinZoom(10);
sv.ShowHGrid(false).ShowVGrid(false).SetLabels("X","Y");
sv.SetXYMin(0,0,0).SetRange(NPOINTS, yMax);
sv.Refresh();
Zoomable().Sizeable();
CtrlLayout(*this, "Window title");
}
GUI_APP_MAIN
{
TestScatter().Run();
}
The Layout is just
LAYOUT(TestScatterLayout, 368, 248)
ITEM(ScatterCtrl, sv, HSizePosZ(28, 40).VSizePosZ(24, 24))
END_LAYOUT
The first problem (the one in which the points are not in the correct position) does not happen when the image is exported, only when its shown.
As for the 2nd problem. How I get a zoom out limited to the size of the data?
-
Attachment: scatter.png
(Size: 95.00KB, Downloaded 699 times)
[Updated on: Sat, 07 September 2013 12:17] Report message to a moderator
|
|
|
 |
|
(SOLVED) ScatterCtrl, 2 questions.
By: rxantos on Tue, 20 August 2013 12:26
|
 |
|
Re: ScatterCtrl, 2 questions.
By: koldo on Fri, 23 August 2013 16:29
|
 |
|
Re: ScatterCtrl, 2 questions.
By: rxantos on Fri, 23 August 2013 17:07
|
 |
|
Re: ScatterCtrl, 2 questions.
By: koldo on Fri, 23 August 2013 18:02
|
 |
|
Re: ScatterCtrl, 2 questions.
By: rxantos on Sat, 24 August 2013 07:21
|
 |
|
Re: ScatterCtrl, 2 questions.
By: rxantos on Sat, 24 August 2013 07:24
|
 |
|
Re: ScatterCtrl, 2 questions.
By: rxantos on Sat, 24 August 2013 07:33
|
 |
|
Re: ScatterCtrl, 2 questions.
By: jerson on Sat, 24 August 2013 09:53
|
 |
|
Re: ScatterCtrl, 2 questions.
By: rxantos on Sat, 24 August 2013 11:04
|
 |
|
Re: ScatterCtrl, 2 questions.
By: koldo on Sat, 24 August 2013 19:12
|
 |
|
Re: ScatterCtrl, 2 questions.
By: rxantos on Sun, 25 August 2013 04:27
|
 |
|
Re: ScatterCtrl, 2 questions.
By: koldo on Mon, 26 August 2013 18:50
|
 |
|
Re: ScatterCtrl, 2 questions.
By: koldo on Thu, 29 August 2013 08:08
|
 |
 |
Re: ScatterCtrl, 2 questions.
By: rxantos on Thu, 29 August 2013 10:48
|
 |
|
Re: ScatterCtrl, 2 questions.
By: koldo on Fri, 30 August 2013 08:18
|
Goto Forum:
Current Time: Tue May 06 23:22:04 CEST 2025
Total time taken to generate the page: 0.05296 seconds
|