WebWrappers/Apps/EchartsPharo/EcEvent.class.st

107 lines
1.9 KiB
Smalltalk
Raw Normal View History

Class {
#name : #EcEvent,
#superclass : #Object,
#instVars : [
'dates',
'color',
'type',
'name',
'label'
],
#category : #EchartsPharo
}
{ #category : #accessing }
EcEvent >> asStringSnippet [
^ '{ type:', ($' asString), self type,($' asString), ',
name:', ($' asString), self name,($' asString), ',
edgeSymbol: [',($' asString),'none',($' asString),',',($' asString),'arrow',($' asString),'],
coordinateSystem:',($' asString),'calendar',($' asString),',
symbolSize: 15,
itemStyle: {
color:', ($' asString),'#',self color asHexString,($' asString),',
shadowBlur: 9,
shadowOffsetX: 1.5,
shadowOffsetY: 3,
shadowColor:',($' asString),'#555',($' asString),
'},
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 |
'[', ($' asString), date asDate yyyymmdd,($' asString) ].
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
]