Hello, I'm trying to put on the same graph a cloud of points and a straight
line calculated by the method of least squares. Not working very well when
I use a code like what goes down:
|x y data scat line k xx yy renderer|
x := #(0 1 2 3 4).
y := #(0 1 2 3 4).
data := OrderedCollection new.
k := 0.
x size timesRepeat: [
k := k + 1. xx := x at: k. yy := y at: k.
data add: xx @ yy
].
scat := ESScatterPlot new.
scat
x: [:each| each value x];
y: [:each| each value y];
baseAxisLine;
valueAxis;
models: data.
line := ESLineDiagram new.
line
x: [:each| each value x];
y: [:each| each value y];
models: data.
renderer := ESDiagramRenderer new.
renderer compositeDiagram
add: scat;
add: line.
renderer open
The chart can be seen in
http://tinypic.com/r/34zeicg/5.
Already grateful for any assistance.
--
Sds.,
Francisco Ary Martins
http://chicoary.wordpress.com
----
"Estes são os meus princípios. Se você não gosta deles, eu tenho outros."
Grouch Marx