Methods

This section describes the methods exposed by the DevExpress.viz namespace.

currentPalette(paletteName)

Applies a predefined or registered custom palette to all visualization widgets at once.

Module: viz/palette
Export: currentPalette
Parameters:
paletteName: String
The palette name.

currentTheme(platform, colorScheme)

Applies a new theme (with the color scheme defined separately) for the entire page with several DevExtreme visualization widgets.

Module: viz/themes
Export: currentTheme
Parameters:
platform: String
The platform name or 'generic'.
colorScheme: String
The color scheme (can be 'light' or 'dark').

For details on how to apply a theme using this method, refer to the Appearance Customization article.

currentTheme(theme)

Applies a theme for the entire page with several DevExtreme visualization widgets.

Module: viz/themes
Export: currentTheme
Parameters:
theme: String
The name of a new theme.

For details on how to apply a theme using this method, refer to the Appearance Customization article.

exportFromMarkup(markup, options)

Allows you to export widgets using their SVG markup.

Module: viz/export
Export: exportFromMarkup
Parameters:
markup: String
The SVG markup of the widgets you need to export.
options: Object
Export options. Can contain the following fields.
  • fileName - the name of the file to be saved.
  • format - the format of the file to be saved.
    Accepted Values: 'PNG' | 'PDF' | 'JPEG' | 'SVG' | 'GIF'
  • height - the pixel-measured height of the SVG block.
    This field is required.
  • width - the pixel-measured width of the SVG block.
    This field is required.
  • backgroundColor - the color that will fill transparent regions.
  • proxyUrl - the URL of a server-side proxy required for export in IE9 and Safari on Mac OS.
    For details, refer to the proxyUrl option of any widget.
See Also

getPalette(paletteName)

Obtains the color sets of a predefined or registered palette.

Module: viz/palette
Export: getPalette
Parameters:
paletteName: String
The palette name.
Return Value: Object
The palette settings.

The returned value is an object of the following structure.

JavaScript
{
    simpleSet: ['#60a69f', '#78b6d9', '#6682bb', '#a37182', '#eeba69'], // for "Chart", "PieChart" and "BarGauge" 
    indicatingSet: ['#90ba58', '#eeba69', '#a37182'], // for "Chart", "PieChart" and "BarGauge"
    gradientSet: ['#78b6d9', '#eeba69'] // for "VectorMap"
};

The built-in palettes are listed in the Appearance Customization topic.

refreshPaths()

The method to be called every time the active entry in the browser history is modified without reloading the current page.

Module: viz/utils
Export: refreshPaths

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.

JavaScript
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()

Module: viz/themes
Export: refreshTheme

registerPalette(paletteName, palette)

Registers a new palette.

Module: viz/palette
Export: registerPalette
Parameters:
paletteName: String
The new palette name.
palette: Object
The new palette settings.

The palette settings is an object of the following structure.

JavaScript
{
    simpleSet: ['#60a69f', '#78b6d9', '#6682bb', '#a37182', '#eeba69'], // for "Chart", "PieChart" and "BarGauge" 
    indicatingSet: ['#90ba58', '#eeba69', '#a37182'], // for "CircularGauge" and "LinearGauge"
    gradientSet: ['#78b6d9', '#eeba69'] // for "VectorMap"
};

registerTheme(customTheme, baseTheme)

Registers a new theme based on the existing one.

Module: viz/themes
Export: registerTheme
Parameters:
customTheme: Object
The new theme settings.
baseTheme: String
The base theme name.

For details on how to customize a theme, refer to the Appearance Customization article.