<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><divclass="CTitle logo"><divclass="nav"><aclass="nav"href="../../index.php"><span>></span>Home</a><aclass="nav"href="../../tests/"><span>></span>Examples</a><aclass="nav"href="../../docs/"><span>></span>Docs</a><aclass="nav"href="http://bitbucket.org/cleonello/jqplot/downloads/"><span>></span>Download</a><aclass="nav"href="../../info.php"><span>></span>Info</a><aclass="nav"href="../../donate.php"><span>></span>Donate</a></div><aname="$.jqplot.ThemeEngine"></a>$.jqplot.<wbr>ThemeEngine</div><divclass=CBody><p>Theme Engine provides a programatic way to change some of the more common jqplot styling options such as fonts, colors and grid options. A theme engine instance is created with each plot. The theme engine manages a collection of themes which can be modified, added to, or applied to the plot.</p><p>The themeEngine class is not instantiated directly. When a plot is initialized, the current plot options are scanned an a default theme named “Default” is created. This theme is used as the basis for other themes added to the theme engine and is always available.</p><p>A theme is a simple javascript object with styling parameters for various entities of the plot. A theme has the form:</p><blockquote><pre>{
}</pre></blockquote><p>”seriesStyles” is a style object that will be applied to all series in the plot. It will forcibly override any styles applied on the individual series. “axesStyles” is a style object that will be applied to all axes in the plot. It will also forcibly override any styles on the individual axes.</p><p>The example shown above has series options for a line series. Options for other series types are shown below:</p><h4class=CHeading>Bar Series</h4><blockquote><pre>{
}</pre></blockquote><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine">$.jqplot.<wbr>ThemeEngine</a></td><tdclass=SDescription>Theme Engine provides a programatic way to change some of the more common jqplot styling options such as fonts, colors and grid options. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.Properties">Properties</a></td><tdclass=SDescription></td></tr><trclass="SProperty SIndent2 SMarked"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.themes"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">themes</a></td><tdclass=SDescription>hash of themes managed by the theme engine. </td></tr><trclass="SProperty SIndent2"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.activeTheme"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">activeTheme</a></td><tdclass=SDescription>Pointer to currently active theme</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.methods">methods</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.get"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">get</a></td><tdclass=SDescription>Get and return the named theme or the active theme if no name given.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.getThemeNames"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">getThemeNames</a></td><tdclass=SDescription>Return the list of theme names in this manager in alpha-numerical order.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.getThemes"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">getThemes</a></td><tdclass=SDescription>Return a list of themes in alpha-numerical order by name.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.remove"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">remove</a></td><tdclass=SDescription>Remove the given theme from the themeEngine.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.newTheme"id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">newTheme</a></td><tdclass=SDescription>Create a new theme based on the default theme, adding it the themeEngine.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.rename"id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">rename</a></td><tdclass=SDescription>Rename a theme.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#$.jqplot.ThemeEngine.copy"id=link9onMouseOver="ShowTip(event, 'tt9', 'link9')"onMouseOut="HideTip('tt9')">copy</a></td><tdclass=SDescription>Create a copy of an existing theme in the themeEngine, adding it the themeEngine.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.ThemeEngine.themes"></a>themes</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.themes = {}</td></tr></table></blockquote><p>hash of themes managed by the theme engine. Indexed by theme name.</p></div></div></div>
<divclass="CProperty"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.ThemeEngine.activeTheme"></a>activeTheme</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.activeTheme=null</td></tr></table></blockquote><p>Pointer to currently active theme</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.ThemeEngine.get"></a>get</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>$.jqplot.ThemeEngine.prototype.get = function(</td><tdclass=PParameternowrap>name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Get and return the named theme or the active theme if no name given.</p><h4class=CHeading>parameter</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>name</td><tdclass=CDLDescription>name of theme to get.</td></tr></table><h4class=CHeading>returns</h4><p>Theme instance of given name.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.ThemeEngine.getThemeNames"></a>getThemeNames</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>$.jqplot.ThemeEngine.prototype.getThemeNames = function()</td></tr></table></blockquote><p>Return the list of theme names in this manager in alpha-numerical order.</p><h4class=CHeading>parameter</h4><p>None</p><h4class=CHeading>returns</h4><p>A the list of theme names in this manager in alpha-numerical order.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.ThemeEngine.getThemes"></a>getThemes</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>$.jqplot.ThemeEngine.prototype.getThemes = function()</td></tr></table></blockquote><p>Return a list of themes in alpha-numerical order by name.</p><h4class=CHeading>parameter</h4><p>None</p><h4class=CHeading>returns</h4><p>A list of themes in alpha-numerical order by name.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.ThemeEngine.remove"></a>remove</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>$.jqplot.ThemeEngine.prototype.remove = function(</td><tdclass=PParameternowrap>name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Remove the given theme from the themeEngine.</p><h4class=CHeading>parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>name</td><tdclass=CDLDescription>name of the theme to remove.</td></tr></table><h4class=CHeading>returns</h4><p>true on success, false on failure.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.ThemeEngine.newTheme"></a>newTheme</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>$.jqplot.ThemeEngine.prototype.newTheme = function(</td><tdclass=PParameternowrap>name,</td></tr><tr><td></td><tdclass=PParameternowrap>obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a new theme based on the default theme, adding it the themeEngine.</p><h4class=CHeading>parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>name</td><tdclass=CDLDescription>name of the new theme.</td></tr><tr><tdclass=CDLEntry>obj</td><tdclass=CDLDescription>optional object of styles to be applied to this new theme.</td></tr></table><h4class=CHeading>returns</h4><p>new Theme object.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.ThemeEngine.rename"></a>rename</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>$.jqplot.ThemeEngine.prototype.rename = function (</td><tdclass=PParameternowrap>oldName,</td></tr><tr><td></td><tdclass=PParameternowrap>newName</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Rename a theme.</p><h4class=CHeading>parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>oldName</td><tdclass=CDLDescription>current name of the theme.</td></tr><tr><tdclass=CDLEntry>newName</td><tdclass=CDLDescription>desired name of the theme.</td></tr></table><h4class=CHeading>returns</h4><p>new Theme object.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="$.jqplot.ThemeEngine.copy"></a>copy</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>$.jqplot.ThemeEngine.prototype.copy = function (</td><tdclass=PParameternowrap>sourceName,</td></tr><tr><td></td><tdclass=PParameternowrap>targetName,</td></tr><tr><td></td><tdclass=PParameternowrap>obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Create a copy of an existing theme in the themeEngine, adding it the themeEngine.</p><h4class=CHeading>parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>sourceName</td><tdclass=CDLDescription>name of the existing theme.</td></tr><tr><tdclass=CDLEntry>targetName</td><tdclass=CDLDescription>name of the copy.</td></tr><tr><tdclass=CDLEntry>obj</td><tdclass=CDLDescription>optional object of style parameter to apply to the new theme.</td></tr></table><h4class=CHeading>returns</h4><p>new Theme object.</p></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.themes = {}</td></tr></table></blockquote>hash of themes managed by the theme engine. </div></div><divclass=CToolTipid="tt2"><divclass=CProperty><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>this.activeTheme=null</td></tr></table></blockquote>Pointer to currently active theme</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>$.jqplot.ThemeEngine.prototype.get = function(</td><tdclass=PParameternowrap>name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Get and return the named theme or the active theme if no name given.</div></div><divclass=CToolTipid="tt4"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>$.jqplot.ThemeEngine.prototype.getThemeNames = function()</td></tr></table></blockquote>Return the list of theme names in this manager in alpha-numerical order.</div></div><divclass=CToolTipid="tt5"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td>$.jqplot.ThemeEngine.prototype.getThemes = function()</td></tr></table></blockquote>Return a list of themes in alpha-numerical order by name.</div></div><divclass=CToolTipid="tt6"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>$.jqplot.ThemeEngine.prototype.remove = function(</td><tdclass=PParameternowrap>name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Remove the given theme from the themeEngine.</div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>$.jqplot.ThemeEngine.prototype.newTheme = function(</td><tdclass=PParameternowrap>name,</td></tr><tr><td></td><tdclass=PParameternowrap>obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Create a new theme based on the default theme, adding it the themeEngine.</div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>$.jqplot.ThemeEngine.prototype.rename = function (</td><tdclass=PParameternowrap>oldName,</td></tr><tr><td></td><tdclass=PParameternowrap>newName</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Rename a theme.</div></div><divclass=CToolTipid="tt9"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class=Prototype><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>$.jqplot.ThemeEngine.prototype.copy = function (</td><tdclass=PParameternowrap>sourceName,</td></tr><tr><td></td><tdclass=PParameternowrap>targetName,</td></tr><tr><td></td><tdclass=PParameternowrap>obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Create a copy of an existing theme in the themeEngine, adding it the themeEngine.</div></div><!--END_ND_TOOLTIPS-->