Dygraph class
Dygraph chart instance.
- Annotations
-
- @JS()
Constructors
- Dygraph(Element? div, dynamic file, [DygraphOptions? options])
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- PointType → DygraphPointType
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
adjustRoll(
int length) → void - Adjusts the number of points in the rolling average.
-
annotations(
) → List - Return the list of annotations.
-
clearSelection(
) → void - Clears the current selection (i.e. points that were highlighted by moving the mouse over the chart).
-
destroy(
) → void - Detach DOM elements in the dygraph and null out all data references.
-
eventToDomCoords(
Event event) → List - Convert a mouse event to DOM coordinates relative to the graph origin.
-
findClosestPoint(
num domX, num domY) → DygraphClosestPointResult - Given canvas X,Y coordinates, find the closest point.
-
getArea(
) → DygraphArea - Get the current graph's area object.
-
getColors(
) → List - Return the list of colors.
-
getHighlightSeries(
) → String - Returns the name of the currently-highlighted series.
-
getLabels(
) → List - Get the list of label names for this graph.
-
getOption(
String name, [String? optSeriesName]) → dynamic - Returns the current value for an option, as set in the constructor or via updateOptions.
-
getPropertiesForSeries(
String seriesName) → DygraphPropertiesForSeries -
Returns a few attributes of a series, i.e. its color, its visibility,
which axis it's assigned to, and its column in the original data.
Returns
null
if the series does not exist. Otherwise, returns an object withcolumn
,visibility
,color
andaxis
properties. Theaxis
property will be set to 1 for y1 and 2 for y2. Thecolumn
property can be fed back intogetValue(row, column)
to get values for this series. -
getRowForX(
int xVal) → int -
Find the row number corresponding to the given x-value.
Returns
null
if there is no such x-value in the data. If there are multiple rows with the same x-value, this will return the first one. -
getSelection(
) → int - Returns the number of the currently selected row. To get data for this row, you can use the getValue method.
-
getValue(
int row, int col) → dynamic - Returns the value in the given row and column.
-
indexFromSetName(
String name) → int - Get the index of a series (column) given its name. The first column is the x-axis, so the data series start with index 1.
-
isSeriesLocked(
) → bool -
Returns true if the currently-highlighted series was locked via
setSelection(..., seriesName, true)
. -
isZoomed(
[String? axis]) → bool - Returns the zoomed status of the chart for one or both axes.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
numAxes(
) → int - Returns the number of y-axes on the chart.
-
numColumns(
) → int - Returns the number of columns (including the independent variable).
-
numRows(
) → int - Returns the number of rows (excluding any header/label row).
-
ready(
dynamic callback(Dygraph dygraph)) → void - Trigger a callback when the dygraph has drawn itself and is ready to be manipulated.
-
resetZoom(
) → void - Reset the zoom to the original view coordinates. This is the same as double-clicking on the graph.
-
resize(
[num? width, num? height]) → void - Resizes the dygraph. If no parameters are specified, resizes to fill the containing div (which has presumably changed size since the dygraph was instantiated. If the width/height are specified, the div will be resized.
-
rollPeriod(
) → int - Returns the current rolling period, as set by the user or an option.
-
setAnnotations(
List< DygraphAnnotation> annotations, [bool? suppressDraw]) → void - Update the list of annotations and redraw the chart. See dygraphs.com/annotations.html for more info on how to use annotations.
-
setSelection(
dynamic row, [String? seriesName, bool? locked]) → void - Manually set the selected points and display information about them in the legend. The selection can be cleared using clearSelection() and queried using getSelection().
-
setVisibility(
dynamic idx, bool visible) → void - Changes the visibility of one or more series.
-
toDataCoords(
[num? x, num? y, num? axis]) → List -
Convert from canvas/div coords to data coordinates.
If specified, do this conversion for the coordinate system of a particular
axis. Uses the first axis by default.
Returns a two-element array:
X, Y
. -
toDataXCoord(
[num? x]) → num - Convert from canvas/div x coordinate to data coordinate.
-
toDataYCoord(
[num? y, num? axis]) → num - Convert from canvas/div y coord to value.
-
toDomCoords(
[num? x, num? y, num? axis]) → List -
Convert from data coordinates to canvas/div X/Y coordinates.
If specified, do this conversion for the coordinate system of a particular
axis. Uses the first axis by default.
Returns a two-element array:
X, Y
-
toDomXCoord(
[num? x]) → num - Convert from data x coordinates to canvas/div X coordinate. If specified, do this conversion for the coordinate system of a particular axis.
-
toDomYCoord(
[num? y, num? axis]) → num - Convert from data x coordinates to canvas/div Y coordinate and optional axis. Uses the first axis by default.
-
toPercentXCoord(
[num? x]) → num - Converts an x value to a percentage from the left to the right of the drawing area.
-
toPercentYCoord(
[num? y, num? axis]) → num - Converts a y for an axis to a percentage from the top to the bottom of the drawing area.
-
toString(
) → String -
Returns information about the Dygraph object, including its containing ID.
override
-
updateOptions(
DygraphOptions options, [bool? blockRedraw]) → void - Changes various properties of the graph. These can include:
-
visibility(
) → List - Returns a boolean array of visibility statuses.
-
xAxisExtremes(
) → List - Returns the lower- and upper-bound x-axis values of the data set.
-
xAxisRange(
) → List - Returns the currently-visible x-range. This can be affected by zooming, panning or a call to updateOptions.
-
yAxisExtremes(
) → List - Returns the lower- and upper-bound y-axis values for each axis. These are the ranges you'll get if you double-click to zoom out or call resetZoom.
-
yAxisRange(
[num? idx]) → List - Returns the currently-visible y-range for an axis. This can be affected by zooming, panning or a call to updateOptions. Axis indices are zero-based. If called with no arguments, returns the range of the first axis.
-
yAxisRanges(
) → List - Returns the currently-visible y-ranges for each axis. This can be affected by zooming, panning, calls to updateOptions, etc.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- addedAnnotationCSS → bool
-
no setter
- ANIMATION_DURATION → num
-
no setter
- ANIMATION_STEPS → num
-
no setter
- DEFAULT_HEIGHT → num
-
no setter
- DEFAULT_ROLL_PERIOD → num
-
no setter
- DEFAULT_WIDTH → num
-
no setter
- defaultInteractionModel → DygraphInteractionModel
-
no setter
- NAME → String
-
no setter
- nonInteractiveModel → DygraphInteractionModel
-
no setter
-
Plugins
→ Map<
String, dynamic> -
no setter
- PLUGINS → List
-
Installed plugins, in order of precedence (most-general to most-specific).
no setter
- VERSION → String
-
no setter
Static Methods
-
dateTicker(
num min, num max, num pixels, [dynamic opts(String v)?, Dygraph? dygraph, List? vals]) → List - Date values ticker function.
-
endPan(
Event e, Dygraph dygraph, DygraphDragContext context) → void - Called in response to an interaction model operation that responds to an event that ends panning.
-
endZoom(
Event e, Dygraph dygraph, DygraphDragContext context) → void - Called in response to an interaction model operation that responds to an event that performs a zoom based on previously defined bounds..
-
movePan(
Event e, Dygraph dygraph, DygraphDragContext context) → void - Called in response to an interaction model operation that responds to an event that pans the view.
-
moveZoom(
Event e, Dygraph dygraph, DygraphDragContext context) → void - Called in response to an interaction model operation that responds to an event that defines zoom boundaries.
-
numericLinearTicks(
num min, num max, num pixels, [dynamic opts(String v)?, Dygraph? dygraph, List? vals]) → List - Numeric linear values ticker function.
-
numericTicks(
num min, num max, num pixels, [dynamic opts(String v)?, Dygraph? dygraph, List? vals]) → List - Numeric values ticker function.
-
startPan(
Event e, Dygraph dygraph, DygraphDragContext context) → void - Called in response to an interaction model operation that should start the default panning behavior.
-
startZoom(
Event e, Dygraph dygraph, DygraphDragContext context) → void - Called in response to an interaction model operation that responds to an event that starts zooming.