WebWrappers/Apps/EchartsPharo/EcEvent.class.st

107 lines
1.7 KiB
Smalltalk
Raw Normal View History

Class {
#name : #EcEvent,
#superclass : #Object,
#instVars : [
'dates',
'color',
'type',
'name',
'label'
],
#category : #EchartsPharo
}
{ #category : #accessing }
EcEvent >> asStringSnippet [
2022-09-19 14:25:14 +00:00
^ '{ type:', '''', self type, '''', ',
name:', '''', self name, '''', ',
edgeSymbol: [', '''','none', '''',',', '''','arrow', '''', '],
coordinateSystem:', '''','calendar', '''',',
symbolSize: 15,
itemStyle: {
2022-09-19 14:25:14 +00:00
color:', '''','#',self color asHexString, '''',',
shadowBlur: 9,
shadowOffsetX: 1.5,
shadowOffsetY: 3,
2022-09-19 14:25:14 +00:00
shadowColor:', '''','#555', '''',
'},
data:', self datesAsString, ',
z: 3
},'
]
{ #category : #accessing }
EcEvent >> color [
^ color
]
{ #category : #accessing }
EcEvent >> color: anObject [
color := anObject
]
{ #category : #accessing }
EcEvent >> dates [
^ dates
]
{ #category : #accessing }
EcEvent >> dates: anObject [
dates := anObject
]
{ #category : #accessing }
EcEvent >> datesAsString [
| tempDates datesCount |
tempDates := self dates.
tempDates ifNil: [ ^ self ].
tempDates := tempDates collect: [ :each | each asDate ].
tempDates := tempDates collect: [ :date |
2022-09-19 14:25:14 +00:00
'[', '''', date asDate yyyymmdd,'''' ].
datesCount := OrderedCollection new.
tempDates doWithIndex: [ :date :i | datesCount add: (date, ',', (i asString), ']') ].
^ '[', (',' join: datesCount ), ']'
]
{ #category : #accessing }
EcEvent >> label [
^ label
]
{ #category : #accessing }
EcEvent >> label: anObject [
label := anObject
]
{ #category : #accessing }
EcEvent >> name [
^ name
]
{ #category : #accessing }
EcEvent >> name: anObject [
name := anObject
]
{ #category : #accessing }
EcEvent >> type [
^ type
]
{ #category : #accessing }
EcEvent >> type: anObject [
type := anObject
]