Creating extension for roassal for exporting histograms.

This commit is contained in:
ruidajo 2022-06-17 17:27:00 -05:00
parent 215e83d66e
commit fdeecc5fde
3 changed files with 18 additions and 12 deletions

View File

@ -20,7 +20,6 @@ exportTweetsHistogramWithBars: aNumberOfBars
tweetsHistogram := RSChart new. tweetsHistogram := RSChart new.
tweetsHistogram extent: 800@200. tweetsHistogram extent: 800@200.
diagram := RSBarPlot new diagram := RSBarPlot new
x: (1 to: subtotals size)
y:subtotals. y:subtotals.
diagram color: (Color r:(91/255) g:(131/255) b:(222/255)). diagram color: (Color r:(91/255) g:(131/255) b:(222/255)).
tweetsHistogram addPlot: diagram. tweetsHistogram addPlot: diagram.
@ -33,14 +32,4 @@ exportTweetsHistogramWithBars: aNumberOfBars
integer; integer;
fontSize: 72 /aNumberOfBars). fontSize: 72 /aNumberOfBars).
tweetsHistogram build. tweetsHistogram build.
tweetsHistogram canvas pngExporter ^ tweetsHistogram canvas exportAsFileNamed: 'tweets-histogram' into: self folder
zoomToShapes;
noFixedShapes;
fileName: (self folder / 'tweets-histogram.png')fullName;
export.
tweetsHistogram canvas pdfExporter
zoomToShapes;
noFixedShapes;
fileName: (self folder / 'tweets-histogram.pdf')fullName;
export.
^ self folder / 'tweets-histogram.png'

View File

@ -0,0 +1,14 @@
*Socialmetrica
exportAsFileNamed: aName into: aFolder
self pngExporter
zoomToShapes;
noFixedShapes;
fileName: (aFolder / (aName, 'png')) fullName;
export.
"self pdfExporter
zoomToShapes;
noFixedShapes;
fileName: (aFolder / (aName, 'pdf')) fullName;
export."
^ aFolder / aName, 'png'

View File

@ -0,0 +1,3 @@
{
"name" : "RSCanvas"
}