This PR aims at refactoring the hierarchy of charts and plots in Roassal by implementing a composite pattern, to make plots behave like charts and charts composed of plots.
That is to say single plots don't require to be added into a RSChart to be displayed anymore. However if you want to display multiple plots together, you'll still need to add them into a chart, a RSCompositeChart, which works in a similar way as RSChart previously did.
Now RSAbstractPlot, all its subclasses and RSCompositeChart inherit from an abstract superclass RSAbstractChart.
A couple examples:
x := 1 to: 9 by: 0.1.
y := x sin.
p := RSLinePlot new x: x y: y.
p open
x1 := 1 to: 9 by: 0.1.
y1 := x1 sin.
x2 := -3 to: 4 by: 0.1.
y2 := x2 squared.
c := RSCompositeChart new.
p1 := RSLinePlot new x: x1 y: y1.
p2 := RSLinePlot new x: x2 y: y2.
c add: p1.
c add: p2.
c open
This PR aims at refactoring the hierarchy of charts and plots in Roassal by implementing a composite pattern, to make plots behave like charts and charts composed of plots. That is to say single plots don't require to be added into a![image](https://github.com/ObjectProfile/Roassal3/assets/124769707/2ea27ebd-82e2-40f5-8d10-0eb683615b2a)
RSChart
to be displayed anymore. However if you want to display multiple plots together, you'll still need to add them into a chart, aRSCompositeChart
, which works in a similar way asRSChart
previously did. NowRSAbstractPlot
, all its subclasses andRSCompositeChart
inherit from an abstract superclassRSAbstractChart
.A couple examples: