Skip to content

Commit

Permalink
Added example for the relative y axis labels
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmontt committed Mar 5, 2024
1 parent e041672 commit 800e775
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Roassal-Chart-Examples/RSHistogramExample.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,28 @@ RSHistogramExample >> example10Objects [
^ c canvas
]

{ #category : 'examples' }
RSHistogramExample >> example11RelativeYAxisLabels [

<script: 'self new example11RelativeYAxisLabels open'>
| data plot |
"The 0 element appears 14 times: 70%"
"The 2 element appears 2 times: 10%"
"The 10 element appears 4 times: 20%"
data := #( 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 10 10 10 10 ).

plot := RSHistogramPlot new
x: data;
relativeVerticalTicks;
yourself.
"Add a label"
plot ylabel: 'Percent'.

plot yTicksRangeMax: 100 numberOfTicks: 6.

^ plot
]

{ #category : 'computing' }
RSHistogramExample >> normal: x mean: mean stdDev: std [
^ (-0.5 * Float twoPi log - std log -
Expand Down

0 comments on commit 800e775

Please sign in to comment.