Refactoring calendar and event calendar for echarts objects strings and improving sunburst segment for echarts format.

This commit is contained in:
ruidajo 2022-09-22 09:27:26 -05:00
parent 2bb7cf53ab
commit 00aa287d17
3 changed files with 21 additions and 9 deletions

View File

@ -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 }

View File

@ -12,7 +12,7 @@ Class {
}
{ #category : #accessing }
EcEvent >> asStringSnippet [
EcEvent >> asEcObjectString [
^ '{ type:', '''', self type, '''', ',
name:', '''', self name, '''', ',

View File

@ -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 }