41 lines
712 B
Smalltalk
41 lines
712 B
Smalltalk
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);'
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
EcSunburst >> segments [
|
|
|
|
^ segments ifNil: [ segments := OrderedCollection new ].
|
|
]
|