Class Index | File Index

Classes


Class StackedGraph


Defined in: StackedGraph.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
StackedGraph(target)
Basic StackedGraph class.
Method Summary
Method Attributes Method Name and Description
 
 
create a canvas inside the target html tag.
 
draw()
draw into canvas
 
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].
 
returns f(x) from the bottom of the series in the stacked graph domain
 
returns f(x) from the top of the series in the stacked graph domain
 
sumAt(x)
 
 
 
 
- 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
  • 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.

    Documentation generated by JsDoc Toolkit 2.4.0 on Sat Jun 08 2013 16:12:54 GMT+0200 (CEST)