ZoomCharts Documentation
ZoomCharts.GeoChart
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
.
Applies one of the built-in themes to the chart. This is an alternative to calling
updateSettings({ theme: ZoomCharts.GeoChart.themes.dark })
.
Parameters
The name of the theme to be applied, must be one of the values defined in the GeoChart.themes
static property.
Return value
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
Returns the Leaflet.Map object to enable any advanced customizations.
Please note that this method might return null
if leaflet.js
has not been loaded yet.
If leaflet.js
is not loaded synchronously in the page, it will be loaded on demand by GeoChart.
In this case the map object will not be available until the load is finished.
To handle this scenario, subscribe to onChartUpdate
event and verify if this method returns non-null value.
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
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
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.
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
Decrements the suspend counter that was set using suspendPaint()
method.
This method also automatically schedules an async repaint.
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.
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.
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
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.GeoChart({ theme: ZoomCharts.GeoChart.themes.dark });
chart.updateSettings({ theme: ZoomChart.GeoChart.themes.dark });
chart.customize("dark");