Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSChart #512

Open
akevalion opened this issue Mar 3, 2023 · 2 comments
Open

RSChart #512

akevalion opened this issue Mar 3, 2023 · 2 comments
Labels

Comments

@akevalion
Copy link
Contributor

from discord

jecisc — hoy a las 16:22
In the end, I'm having this script:

c := RSChart new.
p := RSScatterPlot new x: (housing column: #longitude) values y: (housing column: #latitude) values.
c addPlot: p.
c addDecoration: RSHorizontalTick new.
c addDecoration: RSVerticalTick new.
c open


I think it would be great to add an #open method to charts with default options to make it easier to use charts in simple use cases like:

open
  | canvas |
  canvas := RSChart new.
  canvas addPlot: self.
  canvas addDecoration: RSHorizontalTick new.
  canvas addDecoration: RSVerticalTick new.
  canvas open
akevalion — hoy a las 16:25
I will put it as an issue
My idea for this would be 
p := RSScatterPlot new x: (housing column: #longitude) values y: (housing column: #latitude) values.
p open
 
jecisc — hoy a las 16:26
Yeah exactly 🙂 
By adding that to the charts you can simplify the code this much for simple cases :3
@akevalion
Copy link
Contributor Author

We could also have:

p := RSScatterPlot new x: (housing column: #longitude) values y: (housing column: #latitude) values.
p open: [ :canvas | "Do some customizations on canvas ]


To tweak a little the canvas. The method would do:

open: aBlock
  | canvas |
  canvas := RSChart new.
  canvas addPlot: self.
  canvas addDecoration: RSHorizontalTick new.
  canvas addDecoration: RSVerticalTick new.
  aBlock value: canvas.
  canvas open

@akevalion
Copy link
Contributor Author

Moved to pharo-graphics/Roassal

@akevalion akevalion reopened this Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant