Hi Javier, First of all, RTGrapherBuilder has been obsoleted. Use RTGrapher instead. I guess this is a problem with rounding with RTGrapherBuilder. With RTGrapher, I do not see this behavior. For example: -=-=-=-=-=-=-=-=-=-=-=-= events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0. 7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0. 4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0. 1.0 @ 10.0. 0.0 @ 11.0}. b := RTGrapher new. b extent: 400 @ 200. ds := RTDataSet new. ds dotShape circle color: Color red. ds interaction fixedPopupText: [ :e | e printString ]. ds points: events. ds connectColor: Color blue. ds x: [ :e | e y ]. ds y: [ :e | e x ]. b add: ds. b axisX noTick; noLabel. b axisY noTick; noLabel. b build. b view add: ((RTLine new width: 0.02; color: Color yellow) edgeFrom: b view elements fifth to: b view elements last). b view -=-=-=-=-=-=-=-=-=-=-=-= A deep zoom-in shows everything is okay: Cheers, Alexandre
On Jun 13, 2015, at 8:00 PM, Javier Pimás <elpochodelagente@gmail.com> wrote:
Hi guys, I'm drawing a chart with roassal2 and just discovered that lines are not being drawn exactly as expected. Maybe this is a known problem? I'm running on a few months old pharo4beta image, in linux. Here I attach a screenshot corresponding to the code below. There are more evident examples but this one is easier to debug as it is a straight line made of many segments (zooming a bit you'll see the thin reference line and notice the blue line "bends"). Thanks for reading!
Cheers, Javier
test | b ds events |
events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0. 7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0. 4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0. 1.0 @ 10.0. 0.0 @ 11.0}.
b := RTGrapherBuilder new. b extent: 400 @ 200.
ds := RTDataSet new. ds dotShape circle color: Color red. ds interaction fixedPopupText: [ :e | e printString ].
ds points: events. ds connectColor: Color blue. ds x: [ :e | e y ]. ds y: [ :e | e x ]. b add: ds. b axisXWithNumberOfTicks: events size. ^b build
<image.png> -- Javier Pimás Ciudad de Buenos Aires
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.