2022-04-20 21:44:34 +00:00
|
|
|
accessing
|
|
|
|
exportQuotesHistogram
|
|
|
|
|
2022-04-20 21:59:57 +00:00
|
|
|
| quotesOccurrences labels diagram quotesHistogram |
|
2022-04-20 21:44:34 +00:00
|
|
|
|
|
|
|
quotesOccurrences := self quotesSortedByOccurrences.
|
|
|
|
labels := quotesOccurrences keys.
|
|
|
|
quotesHistogram := RSChart new.
|
|
|
|
quotesHistogram extent: 800@200.
|
2022-04-20 21:59:57 +00:00
|
|
|
diagram := RSBarPlot new
|
|
|
|
x: (1 to: quotesOccurrences size)
|
|
|
|
y: quotesOccurrences values.
|
2022-04-20 21:44:34 +00:00
|
|
|
diagram color: (Color r:(89/255) g:(217/255) b:(95/255)).
|
|
|
|
quotesHistogram addPlot: diagram.
|
|
|
|
quotesHistogram addDecoration: (RSHorizontalTick new
|
|
|
|
fromNames: labels;
|
|
|
|
labelRotation: 0;
|
|
|
|
fontSize: 80 /quotesOccurrences size;
|
|
|
|
yourself).
|
|
|
|
quotesHistogram addDecoration: (RSVerticalTick new
|
|
|
|
integer;
|
|
|
|
fontSize: 80 /quotesOccurrences size).
|
|
|
|
quotesHistogram build.
|
|
|
|
|
|
|
|
quotesHistogram canvas pdfExporter
|
|
|
|
zoomToShapes;
|
|
|
|
noFixedShapes;
|
|
|
|
fileName: (self folder / 'quotes-histogram.pdf')fullName;
|
|
|
|
export.
|
|
|
|
quotesHistogram canvas pngExporter
|
|
|
|
zoomToShapes;
|
|
|
|
noFixedShapes;
|
|
|
|
fileName: (self folder / 'quotes-histogram.png')fullName;
|
|
|
|
export.
|
|
|
|
^ self folder / 'quotes-histogram.png'
|