Class StackedGraph
Defined in: StackedGraph.js.
Constructor Attributes | Constructor Name and Description |
---|---|
StackedGraph(target)
Basic StackedGraph class.
|
Method Attributes | Method Name and Description |
---|---|
baselineAt(x)
|
|
create a canvas inside the target html tag.
|
|
draw()
draw into canvas
|
|
makeHighlighted(series)
tag the given series as highlighted.
|
|
maxSampleInRange(start, end)
maximum sample value in summed-series domain
|
|
samplePosInRange(start, end)
returns a "set" of sample positions within the intervall [start, end].
|
|
seriesBottomInStackedGraphDomain(seriesIndex, x)
returns f(x) from the bottom of the series in the stacked graph domain
|
|
seriesTopInStackedGraphDomain(seriesIndex, x)
returns f(x) from the top of the series in the stacked graph domain
|
|
sumAt(x)
|
|
timeSeriesAt(x, y)
|
|
toInsideOutOrderIndex(index)
|
|
toOrderedSeriesIndex(index)
|
|
- update the canvas size to fit into the target element.
|
Class Detail
StackedGraph(target)
Basic StackedGraph class.
Contains methods to create and draw stacked graphs from a set of time series.
Can be extended to ThemeRivers and Streamgraphs by overriding the baselineAt() function.
Domains
Different domain-spaces are used to locate data: canvas domain pixel coordinates within canvas
normalized-canvas domain canvas domain between 0 and 1
stacked-graph domain domain of time series summed up including baseline offset
summed-series domain domain of time series summed up
series domain domain of one time series
Different domain-spaces are used to locate data:
- Parameters:
- target
- Returns:
Method Detail
baselineAt(x)
- Parameters:
- x
createCanvas()
create a canvas inside the target html tag.
the canvas is used to draw the graphs
draw()
draw into canvas
makeHighlighted(series)
tag the given series as highlighted.
- Parameters:
- series
maxSampleInRange(start, end)
maximum sample value in summed-series domain
- Parameters:
- start
- end
samplePosInRange(start, end)
returns a "set" of sample positions within the intervall [start, end].
- Parameters:
- start
- end
seriesBottomInStackedGraphDomain(seriesIndex, x)
returns f(x) from the bottom of the series in the stacked graph domain
- Parameters:
- seriesIndex
- x
seriesTopInStackedGraphDomain(seriesIndex, x)
returns f(x) from the top of the series in the stacked graph domain
- Parameters:
- seriesIndex
- x
sumAt(x)
- Parameters:
- x
- Returns:
- sum of all series at x in summed-series domain
timeSeriesAt(x, y)
- Parameters:
- x
- in canvas space pixel coordinates
- y
- in canvas space pixel coordinates
- Returns:
- the time series at the specified position
toInsideOutOrderIndex(index)
- Parameters:
- index
toOrderedSeriesIndex(index)
- Parameters:
- index
updateCanvasSize()
- update the canvas size to fit into the target element.