3
그래프 벤치 마크에 대한 막대 그래프를 Pharo에서 Graph-ET로 그렸습니다. 아무도 x 축에 레이블을 추가하는 방법을 알고 있습니까? 각 막대 아래에 벤치 마크의 이름을 쓰고 싶습니다.그래프 ET 축 레이블
그래프 벤치 마크에 대한 막대 그래프를 Pharo에서 Graph-ET로 그렸습니다. 아무도 x 축에 레이블을 추가하는 방법을 알고 있습니까? 각 막대 아래에 벤치 마크의 이름을 쓰고 싶습니다.그래프 ET 축 레이블
를 열고 작업 공간, 그리고 다음을 입력합니다
| chart |
chart := GETDiagramBuilder new.
chart verticalBarDiagram
models: ($a to: $z);
y: #asInteger;
regularAxis;
height: 200.
chart open.
"We use the same model elements"
($a to: $z) do: [ :value |
| bar label |
"We define a label, and add it to the view"
label := ROLabel elementOn: value asString.
chart rawView add: label.
"We get the bar, the gray element that grows up"
bar := chart rawView elementFromModel: value.
"Move the label below its corresponding bar"
ROConstraint move: label below: bar ].
"Inserting high level labels"
chart rawView add: ((ROLabel red elementOn: 'Chart about my life') translateBy: 200 @ 0).
chart rawView add: ((ROLabel elementOn: 'Happiness') translateBy: -30 @ -40).
chart rawView add: ((ROLabel elementOn: 'Passing days') translateBy: 650 @ 210)
GraphET2에서
은 당신이 원하는 것과 같은 건물 차트 (Roassal2를 사용하는) 방법으로 쉽게!
| chart |
chart := GET2Bar data: ($a to: $z).
chart
y: #asInteger;
title: 'Chart about my life';
titleColor: Color red.
chart yAxis title: 'Happiness'.
chart xAxis addModelLabels:[:v | |s| s:= v asString. s,s,s,s. ];
verticalLabelsInverted;
title: 'Passing days'.
chart open.
체크 아웃 here!
도움이 되길 바랍니다.
감사합니다. 그건 그렇고 난 당신의 코드에 수직 레이블을 작성하는 라인을 추가했습니다. 'someString 'joinUsing : Character cr.' – Natalia