WebWrappers/Apps/EchartsPharo/EcSunburst.class.st

41 lines
712 B
Smalltalk
Raw Normal View History

2022-09-19 15:11:10 +00:00
Class {
#name : #EcSunburst,
#superclass : #Object,
#instVars : [
'segments'
],
#category : #'EchartsPharo-EchartsPharo'
}
{ #category : #accessing }
EcSunburst >> asEcScript [
^ 'var mySunburst = echarts.init(document.getElementById(','''', 'sunburst', '''', '));',
Character cr asString,
'var data = [',
']',
Character cr asString,
'var option = {
series: {
type:', '''', 'sunburst', '''', ',
data: data,
radius: [0, ', '''', '90%', '''', '],
label: {
rotate:', '''', 'tangential', '''', ',
fontSize: 15,
}
}
};
mySunburst.setOption(option);'
]
2022-09-19 15:11:10 +00:00
{ #category : #accessing }
EcSunburst >> segments [
^ segments ifNil: [ segments := OrderedCollection new ].
2022-09-19 15:11:10 +00:00
]