ZoomCharts Documentation
ZoomCharts.NetChart
Inheritance hierarchy
This type inherits from BaseApi.
Constructors
Methods
Adds the given data to whatever data the chart has currently loaded. The chart will automatically be updated to display this new data if it falls within the currently visible bounds.
Parameters
the ID of the data source that will be updated. The default value is default
.
Focuses a node. Whether or not the node will get actually focused depends no the navigation mode.
Parameters
Node ID or object
Explicitly assigned relevance (used only by Focusnodes navigation mode). For more information, see the Focusnodes algorithm
See also
- Documentation: Focusnodes algorithm
Return value
Removes focus from all nodes. The exact effect depends on the navigation mode.
Closes a node. The exact effect depends on the navigation mode.
Parameters
Node ID or object
Collapses a node. The exact effect depends on the navigation mode.
Parameters
Node ID or object
Applies one of the built-in themes to the chart. This is an alternative to calling
updateSettings({ theme: ZoomCharts.NetChart.themes.dark })
.
Parameters
The name of the theme to be applied, must be one of the values defined in the NetChart.themes
static property.
Return value
Expands a visible node.
Parameters
Launches a file download that contains an image or the data of the current state of the chart.
Note that in some browsers calling this method will send the data to a proxy. When handling sensitive data you should install the proxy
on your own server, see advanced.exportProxyURL
setting.
Parameters
The format in which the data will be exported.
Specifies the dimensions for the image formats.
false
.Specifies if the resulting image should have transparent background. This setting is only valid for png
image format. Default is false
.
Note that if area.style.fillColor
is set, this will have no effect.
Specifies the fileName to be used, excluding fileExtension
Saves the current chart state as a data-URI.
If image type is specified, the URI can be used as the image source in <img src="">
.
Note that some output settings might require sending the data to a proxy. When handling sensitive data you should install the proxy
on your own server, see advanced.exportProxyURL
setting.
Parameters
The format in which the data will be exported.
Specifies the dimensions for the image formats.
Specifies if the resulting image should have transparent background. This setting is only valid for png
image format. Default is false
.
Note that if area.style.fillColor
is set, this will have no effect.
Returns the dimensions for the image exported with exportImageAsString
.
Parameters
Return value
Saves the current chart state as an image.
Note that this method does not support custom DPI setting, for that exportAsString
method has to be used.
Parameters
Return value
A base64 encoded data-URI that contains the image data. This URI can be used as the image source in <img src="">
.
Returns the dimensions for the image exported with exportImageAsString
.
Parameters
Return value
Hides a visible node. Whether or not the node will get actually hidden depends on the navigation mode.
Parameters
Node ID or object
Return value
Fixates a node in place.
Parameters
Return value
Removes an event listener that was added by a call to on
or by specifying it in settings.
Note that the listener must be the exact same reference, which means that anonymous functions should not be used in call to on
.
Parameters
the type of the event. Please see the documentation for on
about valid values.
Parameters
Return value
true
if the listener was removed, false
if the listener was not previously registered.
Adds event listener.
Parameters
The type of the event for which the listener will be added. See method overloads for valid values.
The callback function. It receives two arguments - the mouse event data and a separate object containing chart specific information.
Parameters
Overloads
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
An empty mouse event.
Parameters
Parameters
Adds an event listener for pointer down event.
Parameters
Parameters
Adds an event listener for pointer down event.
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
Removes chart from DOM. This method is automatically called when you create a new chart within the same container element.
This method should always be called when the chart HTML element is removed as otherwise there might be additional resources such as event handlers remaining that will prevent the browser from properly releasing memory.
Removes the given nodes and links from the chart. Note that only the ID values have to be given, all other properties are ignored.
Parameters
Removes focus from a node. Whether or not the node will get actually unfocused depends on the navigation mode.
Parameters
Node ID or object
Replaces the data already in the data cache with the given values.
Parameters
the ID of the data source that will be updated. The default value is default
.
Updates the chart settings but instead of merging some settings that are arrays or dictionaries (such as data
)
these collections are replaced completely. For example, this allows removal of series or value axis within TimeChart.
Parameters
Return value
Rearranges all nodes to their default locations (note that for dynamic layout these positions are not deterministic) and enables automatic "overview" zoom.
Note that these actions are done without animations.
Decrements the suspend counter that was set using suspendPaint()
method.
This method also automatically schedules an async repaint.
Animates the viewport to zoom into and contain the nodes specified in the given array
Parameters
Set/Get selected objects.
Parameters
array of objects identifiers to select. Do not pass this parameter if you don't want to change current selection.
Return value
currently selected objects.
Shows a node by its ID. The data for the node gets requested in the standard manner. Whether or not the node will get actually shown depends on the navigation mode.
Parameters
Node ID
Shows context menu, when either node id or INode interface object is passed as a parameter.
Parameters
Suspends the animation of the chart until resumePaint()
is called.
This should be used when the chart element is hidden from the user to conserve browser resources.
Note that if suspendPaint()
is called multiple time then resumePaint()
has to be called the same number of times.
Unfixates a node and allows it to be repositioned by the layout algorithms.
Parameters
Node ID or object
Updates the chart settings. Only the settings that have to be changed should be passed. Note that some arrays
and dictionaries (such as data
) are merged by the ID values - if instead they should be replaced, use
replaceSettings()
method.
Parameters
Return value
animate
parameter.zoomValue
parameter.Gets or sets the current zoom level of the chart. A zoom level of 1
means that all nodes are rendered
with the radius that is set in their configuration. A zoom level of 2
means that all nodes are twice
the size and 0.5
means that all nodes are two times smaller than their specified radiuses.
The zoom level is limited by interaction.zooming.zoomExtent
setting.
Passing auto
will enable the simple auto-zoom mode, passing overview
will enable the auto-zoom that shows
the whole network.
Parameters
if specified and greater than zero, the zoom level will be updated to this value.
specifies if the zoom change should be animated. The default is true
.
Return value
the current zoom level. Note that if the zoom level is changed with an animation, the method returns the current and not the target level.
Static properties
Lists the predefined themes for the chart. These can be used within the settings objects or via the customize()
method:
var chart = new ZoomCharts.NetChart({ theme: ZoomCharts.NetChart.themes.dark });
chart.updateSettings({ theme: ZoomChart.NetChart.themes.dark });
chart.customize("dark");