2022-04-20 21:44:34 +00:00
|
|
|
accessing
|
|
|
|
exportQuotesHistogramWithBars: aNumberOfBars
|
|
|
|
|
2022-06-21 18:20:46 +00:00
|
|
|
| quotesDict |
|
|
|
|
quotesDict := {
|
|
|
|
'messagesType' -> 'quotes'.
|
|
|
|
'extent' -> (800@200).
|
|
|
|
'color' -> (Color r:(89/255) g:(217/255) b:(95/255))
|
|
|
|
} asDictionary.
|
|
|
|
^ self exportHistogramFor: quotesDict By: aNumberOfBars
|
|
|
|
|
|
|
|
|
|
|
|
"| keysToRemove quotes labels quotesHistogram diagram |
|
2022-06-21 16:59:13 +00:00
|
|
|
quotes := self quotes asMessagesUserNamesSortedByOccurrences.
|
2022-04-20 21:44:34 +00:00
|
|
|
(aNumberOfBars > quotes size) ifTrue: [ ^ self exportQuotesHistogram ].
|
|
|
|
keysToRemove := OrderedCollection new.
|
|
|
|
1 to: quotes size - aNumberOfBars do:
|
|
|
|
[ :i | keysToRemove add: (quotes keys at: i + aNumberOfBars) ].
|
|
|
|
quotes removeKeys: keysToRemove.
|
|
|
|
|
|
|
|
labels := quotes keys.
|
2022-04-28 04:51:53 +00:00
|
|
|
labels := labels collect: [ :profiles | ('@', profiles) ].
|
2022-04-20 21:44:34 +00:00
|
|
|
quotesHistogram := RSChart new.
|
|
|
|
quotesHistogram extent: 800@200.
|
2022-04-20 21:59:57 +00:00
|
|
|
diagram := RSBarPlot new
|
|
|
|
y: quotes 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;
|
2022-04-28 04:51:53 +00:00
|
|
|
fontSize: 72 /quotes size;
|
2022-04-20 21:44:34 +00:00
|
|
|
yourself).
|
|
|
|
quotesHistogram addDecoration: (RSVerticalTick new
|
2022-05-03 16:05:56 +00:00
|
|
|
asFloat: 2;
|
2022-04-28 04:51:53 +00:00
|
|
|
fontSize: 72 /quotes size).
|
2022-04-20 21:44:34 +00:00
|
|
|
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.
|
2022-06-21 18:20:46 +00:00
|
|
|
^ self folder / 'quotes-histogram.png'"
|