Roassal3
Roassal3 copied to clipboard
Issue with the scaling and ticks
check this:
| c p classes names x y |
classes := Collection withAllSubclasses.
x := classes collect: #numberOfMethods.
y := classes collect: #linesOfCode.
c := RSChart new.
c extent: 400@400.
c addPlot: (p := RSScatterPlot new x: x y: y; color: Color blue translucent; yourself).
c addDecoration: (RSHorizontalTick new
yourself).
c xlabel: 'Classes'.
c yLog.
"c addDecoration: (RSVerticalTick new
numberOfTicks: 10;
asFloat)."
c ylabel: 'Lines of code'.
c title: 'Collection withAllSubClasses'.
c addDecoration: (vertical := RSVerticalTick new).
vertical shape dashed.
vertical numberOfTicks: 10.
vertical configuration tickSize: c extent x negated.
c build.
popup := RSPopup text: [ :cls | cls name, String crlf, cls linesOfCode asString ].
ellipses := c canvas shapes select: [ :shape | shape class = RSEllipse ].
ellipses with: classes do: [ :shape :cls |
shape model: cls.
shape addInteraction: popup.
].
c canvas
I would hope to have something like:

The order of yLog matters, try this:
| c p classes names x y |
classes := Collection withAllSubclasses.
x := classes collect: #numberOfMethods.
y := classes collect: #linesOfCode.
c := RSChart new.
c extent: 400@400.
c addPlot: (p := RSScatterPlot new x: x y: y; color: Color blue translucent; yourself).
c addDecoration: (RSHorizontalTick new
yourself).
c xlabel: 'Classes'.
"c addDecoration: (RSVerticalTick new
numberOfTicks: 10;
asFloat)."
c ylabel: 'Lines of code'.
c title: 'Collection withAllSubClasses'.
c addDecoration: (vertical := RSVerticalTick new).
vertical shape dashed.
vertical numberOfTicks: 10.
vertical configuration tickSize: c extent x negated.
c yLog.
c build.
popup := RSPopup text: [ :cls | cls name, String crlf, cls linesOfCode asString ].
ellipses := c canvas shapes select: [ :shape | shape class = RSEllipse ].
ellipses with: classes do: [ :shape :cls |
shape model: cls.
shape addInteraction: popup.
].
c canvas

Should RSChart have a general scale for all their plots and decorations?
We can close this as it was fixed on: https://github.com/ObjectProfile/Roassal3/pull/528
Mark as done