Timeline.HotZoneGregorianEtherPainter class
A hot-zone Gregorian ether painter
is just like a
Timeline.GregorianEtherPainter,
except that it also handles the hot-zones of a
hot-zone ether.
Initialization
The constructor of Timeline.HotZoneGregorianEtherPainter
takes an object whose fields (listed below) specify initialization
settings for the ether.
theme
required, a
theme object that
stores default visual settings. In fact, some visual settings
can only be set in this theme object.
unit
required, one of the Gregorian calendar unit defined in
Timeline.DateTime,
e.g.,
Timeline.DateTime.WEEK.
This argument specifies the interval at which ticks and labels
are painted on the band's background
outside the hot-zones.
align
optional, one of
"Left",
"Right",
"Top", and
"Bottom", specifying which edge of the band
markings are drawn. By default, markings are drawn on the bottom edges
of bands in horizontal timelines, and on the right edges of bands in
vertical timelines. This setting overrides either the
hAlign or the
vAlign field of
theme.ether.interval.marker.
showLine
optional, a boolean specifying whether full lines (from edge
to edge)should be drawn at regular intervals. This setting overrides
theme.ether.interval.line.show.
zones
required, an array describing the hot zones. Each element of
this array is an object with the following fields:
startTime
required, a
String or a
Date object that specifies the
beginning date/time of the zone. It is parsed by
Timeline.DateTime.parseGregorianDateTime()
to get a
Date object.
endTime
required, a
String or a
Date object that specifies the
ending date/time of the zone. It is parsed by
Timeline.DateTime.parseGregorianDateTime()
to get a
Date object.
unit
required, one of the Gregorian calendar unit defined in
Timeline.DateTime,
e.g.,
Timeline.DateTime.MINUTE.
This argument specifies the interval at which ticks and labels
are painted on the band's background
inside this hot-zone.
multiple
optional, default to 1. A label is painted for every
multiple of
unit. For example, if
unit is
Timeline.DateTime.MINUTE and
multiple is 15, then there
is a label for every 15 minutes (i.e., 15, 30, 45,...).
Note that you can and should use the same array you use to initialize the
corresponding hot-zone ether. Doing so avoids mistakenly define
different zones for the ether and the ether painter. For each
element in the
zones array,
specify the union of fields:
startTime,
endTime,
magnify,
unit, and (optionally)
multiple.
Here is an example of constructing a hot-zone Gregorian ether painter:
new Timeline.HotZoneGregorianEtherPainter({
theme: Timeline.getDefaultTheme(),
unit: Timeline.DateTime.DAY,
zones: [
{ start: "Fri Nov 22 1963 00:00:00 GMT-0600",
end: "Mon Nov 25 1963 00:00:00 GMT-0600",
unit: Timeline.DateTime.HOUR,
multiple: 3
},
{ start: "Fri Nov 22 1963 09:00:00 GMT-0600",
end: "Fri Nov 22 1963 21:00:00 GMT-0600",
unit: Timeline.DateTime.MINUTE,
multiple: 15
}
]
});
The ether painter paints a label for each day except during
November 22, 23, and 24, 1963. On these 3 days, a label is
painted for every 3 hours, except from 9am to 9pm on November
22 when a label is painted for every 15 minutes.
Related Topics