Refactoring calendar and event calendar for echarts objects strings and improving sunburst segment for echarts format.
This commit is contained in:
parent
2bb7cf53ab
commit
00aa287d17
@ -45,7 +45,7 @@ EcCalendar >> asEcScript [
|
||||
'},
|
||||
|
||||
series: [', Character cr asString,
|
||||
self eventsAsStringSnippets,
|
||||
self eventsAsEcObjectsString,
|
||||
']
|
||||
};
|
||||
myCalendar.setOption(option);'
|
||||
@ -102,12 +102,12 @@ EcCalendar >> events [
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
EcCalendar >> eventsAsStringSnippets [
|
||||
EcCalendar >> eventsAsEcObjectsString [
|
||||
|
||||
| tempEvents |
|
||||
tempEvents := self events.
|
||||
tempEvents ifNil: [ ^ self ].
|
||||
^ Character cr join: (tempEvents collect: [ :each | each asStringSnippet ])
|
||||
^ Character cr join: (tempEvents collect: [ :each | each asEcObjectString ])
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
@ -12,7 +12,7 @@ Class {
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
EcEvent >> asStringSnippet [
|
||||
EcEvent >> asEcObjectString [
|
||||
|
||||
^ '{ type:', '''', self type, '''', ',
|
||||
name:', '''', self name, '''', ',
|
||||
|
@ -33,11 +33,23 @@ EcSunburstSegment class >> rootName: aString [
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegment >> asEcObjectString [
|
||||
|
||||
^ '{ name: ', name, ',
|
||||
value: ', value asString, ',
|
||||
color: ', '''', color asHTMLColor, '''', ',
|
||||
children: []', Character cr asString,
|
||||
'}'
|
||||
self isRoot
|
||||
ifFalse: [
|
||||
^ '{ name: ', name, ',
|
||||
value: ', value asString, ',
|
||||
color: ', '''', (color ifNil: [ '' ] ifNotNil: [ color asHTMLColor ]), '''', ',
|
||||
children: [',
|
||||
']',
|
||||
Character cr asString,
|
||||
'}'
|
||||
]
|
||||
ifTrue: [
|
||||
^ '{ name: ', name, ',
|
||||
color: ', '''', (color ifNil: [ '' ] ifNotNil: [ color asHTMLColor ]), '''', ',
|
||||
children: []',
|
||||
Character cr asString,
|
||||
'}'
|
||||
]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
Loading…
Reference in New Issue
Block a user