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,12 +33,24 @@ EcSunburstSegment class >> rootName: aString [
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegment >> asEcObjectString [
|
||||
|
||||
self isRoot
|
||||
ifFalse: [
|
||||
^ '{ name: ', name, ',
|
||||
value: ', value asString, ',
|
||||
color: ', '''', color asHTMLColor, '''', ',
|
||||
children: []', Character cr 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 }
|
||||
EcSunburstSegment >> children [
|
||||
|
Loading…
Reference in New Issue
Block a user