Vue Common - utils - viz - Methods
This section describes the methods exposed by the DevExpress.viz namespace.
currentPalette(paletteName)
Changes the current palette for all data visualization widgets on the page.
A new palette's name.
Only the widgets created after calling this method use the new palette. Refresh the styling settings in other widgets using the DevExpress.viz.refreshTheme() method.
See Also
currentTheme()
Gets the current theme's name.
The current theme's name.
currentTheme(platform, colorScheme)
Changes the current theme for all data visualization widgets on the page. The color scheme is defined separately.
Only the widgets created after calling this method use the new theme. Refresh the styling settings in other widgets using the DevExpress.viz.refreshTheme() method.
See Also
currentTheme(theme)
Changes the current theme for all data visualization widgets on the page.
A new theme's name.
Only the widgets created after calling this method use the new palette. Refresh the styling settings in other widgets using the DevExpress.viz.refreshTheme() method.
See Also
exportFromMarkup(markup, options)
Allows you to export widgets using their SVG markup.
The SVG markup of the widgets you want to export.
Export options.
Name | Type | Description |
---|---|---|
fileName |
The name of the file to be saved. |
|
format |
The file's format. One of 'PNG', 'PDF', 'JPEG', 'SVG' and 'GIF'. |
|
backgroundColor |
The color that fills transparent regions. |
|
proxyUrl |
The URL of a server-side proxy required for export in Safari on Mac OS. See proxyUrl for details. |
|
width |
The SVG block's width in pixels. This field is required. |
|
height |
The SVG block's height in pixels. This field is required. |
|
onExporting |
Allows you to request exporting details and prevent exporting.
|
|
onExported |
Allows you to notify a user when exporting completes. |
|
onFileSaving |
Allows you to access exported data and/or prevent it from being saved to a file on the user's local storage.
|
|
margin |
An empty space to be added around the exported SVG block; measured in pixels. |
getMarkup(widgetInstances)
Gets the SVG markup of specific widgets for their subsequent export.
The widgets' SVG markup. Pass it to the exportFromMarkup(markup, options) method to export the widgets.
getPalette(paletteName)
Gets the color sets of a predefined or registered palette.
The returned value is an object of the following structure.
{ simpleSet: ['#60a69f', '#78b6d9', '#6682bb', '#a37182', '#eeba69'], // for "Chart", "PieChart", "BarGauge", "Funnel", // and "TreeMap" with a gradient or range colorizer indicatingSet: ['#90ba58', '#eeba69', '#a37182'], // for "CircularGauge" and "LinearGauge" gradientSet: ['#78b6d9', '#eeba69'] // for "VectorMap" and "TreeMap" with a gradient or range colorizer }
The built-in palettes are listed in the Appearance Customization topic.
getTheme(theme)
Gets a predefined or registered theme's settings.
refreshPaths()
The method to be called every time the active entry in the browser history is modified without reloading the current page.
Each data visualization widget addresses its inner elements by their URLs. Those URLs break when the active history entry is modified without reloading the current page (see Adding and modifying history entries). As a result, some widget elements may get mixed up or disappear completely. To fix the URLs, call the refreshPaths() method right after the history entry modification, and in the onpopstate event handler or, if you use a routing library, in its counterpart.
window.history.pushState({ foo: "bar" }, "title", "?foo=bar"); DevExpress.viz.refreshPaths(); window.onpopstate = function(event) { DevExpress.viz.refreshPaths(); }
The problem with broken URLs may also emerge if the page uses a path modifying HTML tag; for example, <base>
or <iframe>
. To resolve it, set the pathModified option of the widget to true.
refreshTheme()
Refreshes the current theme and palette in all data visualization widgets on the page.
registerPalette(paletteName, palette)
Registers a new palette.
The palette settings is an object of the following structure.
{ simpleSet: ['#60a69f', '#78b6d9', '#6682bb', '#a37182', '#eeba69'], // for "Chart", "PieChart", "BarGauge", "Funnel", // and "TreeMap" with a gradient or range colorizer indicatingSet: ['#90ba58', '#eeba69', '#a37182'], // for "CircularGauge" and "LinearGauge" gradientSet: ['#78b6d9', '#eeba69'] // for "VectorMap" and "TreeMap" with a gradient or range colorizer }
registerTheme(customTheme, baseTheme)
Registers a new theme based on the existing one.
For details on how to customize a theme, refer to the Appearance Customization article.
If you have technical questions, please create a support ticket in the DevExpress Support Center.