ZoomCharts Documentation
ZoomCharts.PieChart
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.PieChart.themes.dark })
.
Parameters
The name of the theme to be applied, must be one of the values defined in the PieChart.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
Return value
Return 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
Parameters
Parameters
Parameters
Parameters
Parameters
Parameters
An empty mouse 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.
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.
Retrieves or updates the selected slices on the chart.
Parameters
The slices or their IDs that should be selected. Any currently selected slices that are not present will be unselected.
Return value
An array of currently selected slices after the changes have been applied.
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.
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.PieChart({ theme: ZoomCharts.PieChart.themes.dark });
chart.updateSettings({ theme: ZoomChart.PieChart.themes.dark });
chart.customize("dark");