dojox/charting/Theme (version 1.10)

dojox/charting/SimpleTheme

Summary

A Theme is a pre-defined object, primarily JSON-based, that makes up the definitions to style a chart. It extends SimpleTheme with additional features like color definition by palettes and gradients definition.

Usage

var foo = new Theme(kwArgs);
dojox/charting/SimpleTheme
Parameter Type Description
kwArgs undefined

See the dojox/charting/Theme reference documentation for more information.

Property Summary

Method Summary

  • _buildMarkerArray()
  • addMarker(name,segment) Add a custom marker to this theme.
  • addMixin(theme,elementType,mixin,doPost) Add a mixin object to the passed theme and process.
  • clear() Clear and reset the internal pointer to start fresh.
  • clone() Clone the current theme.
  • defineColors(kwArgs) Generate a set of colors for the theme based on keyword arguments.
  • generateGradient(fillPattern,colorFrom,colorTo)
  • generateHslColor(color,luminance)
  • generateHslGradient(color,fillPattern,lumFrom,lumTo)
  • getTick(name,mixin) Calculates and merges tick parameters.
  • inspectObjects(f)
  • next(elementType,mixin,doPost) Get the next color or series theme.
  • post(theme,elementType) Process any post-shape fills.
  • reverseFills()
  • setMarkers(obj) Set all the markers of this theme at once. obj should be a dictionary of keys and path segments.
  • skip() Skip the next internal color.

Properties

defaultColors
defaultMarkers
defaultTheme
shapeSpaces

Methods

_buildMarkerArray()
addMarker(name,segment)

Add a custom marker to this theme.

Parameter Type Description
name String
segment String

Examples

Example 1

myTheme.addMarker("Ellipse", foo);
addMixin(theme,elementType,mixin,doPost)

Add a mixin object to the passed theme and process.

Parameter Type Description
theme dojox/charting/SimpleTheme

The theme to mixin to.

elementType String

The type of element in question. Can be "line", "bar" or "circle"

mixin Object | Array

The object or objects to mix into the theme.

doPost Boolean

If true, run the new theme through the post-processor.

Returns:dojox/charting/SimpleTheme | undefined

The new theme.

clear()

Clear and reset the internal pointer to start fresh.

clone()

Clone the current theme.

Returns:dojox.charting.SimpleTheme | instance

The cloned theme; any alterations made will not affect the original.

defineColors(kwArgs)

Generate a set of colors for the theme based on keyword arguments.

Parameter Type Description
kwArgs Object

The arguments object used to define colors.

Returns:dojo/_base/Color[] | Array | undefined

An array of colors for use in a theme.

Examples

Example 1

var colors = Theme.defineColors({
    base: "#369",
    generator: "compound"
});

Example 2

var colors = Theme.defineColors({
    hue: 60,
    saturation: 90,
    low: 30,
    high: 80
});
generateGradient(fillPattern,colorFrom,colorTo)
Parameter Type Description
fillPattern undefined
colorFrom undefined
colorTo undefined
Returns:undefined
generateHslColor(color,luminance)
Parameter Type Description
color undefined
luminance undefined
Returns:undefined
generateHslGradient(color,fillPattern,lumFrom,lumTo)
Parameter Type Description
color undefined
fillPattern undefined
lumFrom undefined
lumTo undefined
Returns:undefined
getTick(name,mixin)

Calculates and merges tick parameters.

Parameter Type Description
name String

Tick name, can be "major", "minor", or "micro".

mixin Object
Optional

Optional object to mix in to the tick.

Returns:undefined
inspectObjects(f)
Parameter Type Description
f undefined
next(elementType,mixin,doPost)

Get the next color or series theme.

Parameter Type Description
elementType String
Optional

An optional element type (for use with series themes)

mixin Object
Optional

An optional object to mix into the theme.

doPost Boolean
Optional

A flag to post-process the results.

Returns:Object | undefined

An object of the structure { series, marker, symbol }

post(theme,elementType)

Process any post-shape fills.

Parameter Type Description
theme dojox/charting/SimpleTheme

The theme to post process with.

elementType String

The type of element being filled. Can be "bar" or "circle".

Returns:dojox/charting/SimpleTheme | undefined

The post-processed theme.

reverseFills()
setMarkers(obj)

Set all the markers of this theme at once. obj should be a dictionary of keys and path segments.

Parameter Type Description
obj Object

Examples

Example 1

myTheme.setMarkers({ "CIRCLE": foo });
skip()

Skip the next internal color.

Error in the documentation? Can’t find what you are looking for? Let us know!