Difference between revisions of "Widget Editor Theme Tab"
From dataZoa Wiki
m |
|||
Line 33: | Line 33: | ||
<div style="margin: 2em; margin-left: 6em;"> | <div style="margin: 2em; margin-left: 6em;"> | ||
<table class="Gbb1" style="width:100%;"> | <table class="Gbb1" style="width:100%;"> | ||
− | <tr><td>Description or enhancement</td><td>Code for enhancement</td></tr> | + | <tr><td style="width:40%;">Description or enhancement</td><td style="width:60%;">Code for enhancement</td></tr> |
<tr><td>Move legend to right of chart (particularly useful for pie type displays).</td> | <tr><td>Move legend to right of chart (particularly useful for pie type displays).</td> | ||
<td> | <td> | ||
Line 62: | Line 62: | ||
</td> | </td> | ||
</tr> | </tr> | ||
− | <tr><td>Set tooltip prefix, suffix, decimals and date format | + | <tr><td>Set tooltip prefix, suffix, decimals and date format (<i>%b = Month abbreviation, %m = Month number, %d = Day number %y = 2 digit year, %Y = 4 digit year</i>).</td> |
<td> | <td> | ||
<nowiki>{ | <nowiki>{ |
Revision as of 10:56, 11 September 2018
Themes:
Select a theme to use in applying colors and style to the Widget. There are a handful of preconfigured themes to choose from with their basic affects visible in the Theme Preview to the right.
The Theme Preview can also be used to view the source code of the applied theme which can be useful for learning how to construct custom themes or specific enhancements.
Advanced Options
Advanced Options
Remote Theme:
Optionally bypass all the preconfigured themes by linking to a custom remote theme file.
- Using https is required to ensure proper loading of themes
- Themes are JavaScript files which set and apply Highchart options
- Namespace your theme object as: Highchart.theme = {...}
- After creation, apply your theme via: Highcharts.setOptions(Highcharts.theme);
Can be used to load Highcharts plugins and modules in addition to custom themes.
Enhancements:
Enhance or override any setting of the applied theme (e.g. add a subtitle, change fonts, refine tooltip behavior...)
- Enhancements must be entered as a valid JavaScript object literal which will be applied after the theme and a handful of preset dataZoa options for full flexibility.
- Only options and properties recognized by Highcharts will have an affect... Highcharts Options Reference
- Widgets are loaded with Highcharts v6.0.4 and the following modules: Data, 3D, Boost, More and Exporting
- Use the full Preview tab to visualize the affects of enhancements. Such changes are not reflected in the Theme Preview.
Examples:
Description or enhancement | Code for enhancement |
Move legend to right of chart (particularly useful for pie type displays). |
{ legend: { layout:'vertical', align:'right', verticalAlign:'middle' } } |
Enable crosshairs on hover for x axis only. |
{ tooltip: { crosshairs:[true] } } |
Enable crosshairs on hover for y axis only. |
{ tooltip: { crosshairs:[false, true] } } |
Enable crosshairs on hover for both axes. |
{ tooltip: { crosshairs:[true,true] } } |
Set tooltip prefix, suffix, decimals and date format (%b = Month abbreviation, %m = Month number, %d = Day number %y = 2 digit year, %Y = 4 digit year). |
{ tooltip: { valuePrefix:'$', valueSuffix:' USD', valueDecimals:2, xDateFormat:'%b-%d-%Y' } } |
Change y axis to logarithmic scale. |
{ yAxis: { type:'logarithmic' } } |
Display y axis on opposite (right) side. |
{ yAxis: { opposite:true } } |
Add prefix/suffix to y axis labels. |
{ yAxis: { labels: { format:'${value} USD' } } } |
Add prefix/suffix to y axis labels while maintaining normal value decimating. |
{ yAxis: { labels: { formatter:function(){ return '$'+this.axis.defaultLabelFormatter.call(this)+' USD'; } } } } |
Force y axis labels to use 2 decimal points of precision. |
{ yAxis: { labels: { format:'{value:.2f}' } } } |