Difference between revisions of "Widget Editor Theme Tab"

From dataZoa Wiki
Jump to: navigation, search
m (Y-Axis Examples:)
(Miscellaneous Examples:)
Line 303: Line 303:
 
  <nowiki>{
 
  <nowiki>{
 
   yAxis: { stackLabels: { enabled:true } }
 
   yAxis: { stackLabels: { enabled:true } }
 +
}</nowiki>
 +
  </td>
 +
</tr>
 +
<tr><td>Set abbreviations used to shorten large numbers in y-axis labels (symbols set as null causes full numbers to be shown).</td>
 +
  <td>
 +
<nowiki>{
 +
  chart: { events: { load:function(){ Highcharts.setOptions({ lang: { numericSymbols:['Tho', 'Mil', 'Bil', 'Tri', 'Qud', 'Qun'] } }); this.redraw(); } } }
 
}</nowiki>
 
}</nowiki>
 
   </td>
 
   </td>

Revision as of 10:52, 23 October 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 effects 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

Remote Theme:

Optionally bypass all the preconfigured themes by linking to a custom remote theme file. A remote theme is a resource from outside of dataZoa, typically reflecting particular branding and behavior options used throughout your organization for consistent look and feel.

  • 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 effect... Highcharts Options Reference
  • Widgets automatically load Highcharts v6.0.4 and the following modules: Data, 3D, Boost, More and Exporting
  • Use the full Preview tab to visualize the effects of enhancements. Such changes are not reflected in the Theme Preview.


Title Examples:
Description or enhancement Code for enhancement
Set title styling: font, size, weight and color.
{
   title: { style: { fontFamily:'Times New Roman', fontSize:'21px', fontWeight:'bold', color:'#0000FF' } }
}
Add a subtitle.
{
   subtitle: { text:'This is just the beginning', style:{ color:'#777777;' } }
}
Tooltip Examples:
Description or enhancement Code for enhancement
Enable crosshairs on hover for: [x-axis, y-axis]
{
   tooltip: { crosshairs:[false, true] }
}
Set tooltip prefix, suffix, decimals and date format (%B= Month full name, %b = Month abbreviation, %m = Month number, %d = Day number, %Y = 4 digit year, %y = 2 digit year).
{
   tooltip: { valuePrefix:'$', valueSuffix:' USD', valueDecimals:2, xDateFormat:'%b-%d-%Y' }
}
Separate tooltips for each series displayed one-at-a-time (e.g. for whichever series is being hovered over).
{
   tooltip: { shared:false }
}
Separate tooltips foe each series displayed simultaneously.
{
   tooltip: { split:true }
}


Legend Examples:
Description or enhancement Code for enhancement
Move the legend to the right of the chart (particularly useful for pie type displays).
{
   legend: { layout:'vertical', align:'right', verticalAlign:'middle' }
}
Add some styling to legend items.
{
   legend: { itemStyle:{ fontFamily:'Helvetica', fontWeight:'bold' } }
}
Add a styled title to the legend.
{
   legend: { title:{ text:'I am Legend', style:{ fontSize:'1.5em', textDecoration:'underline' } } }
}
Prevent a series from being removed when clicking it within the legend (for non-pie type displays).
{
   plotOptions: { series: { events: { legendItemClick:function () { return false; } } } }
}
Prevent a series from being removed when clicking it within the legend (for pie type displays).
{
   plotOptions: { pie: { point: { events: { legendItemClick:function () { return false; } } } } }
}
Y-Axis Examples:
Description or enhancement Code for enhancement
Enable a 2nd y-axis on the right and display the 4th series there (axes are indexed starting at 0 instead of 1). Note: Additional y-axes are allowed and all of the following settings can be applied to any of them.
{
   yAxis: [{ title:{ text:'Left yAxis' } }, { title:{ text:'Right yAxis' }, opposite:true }],
   series: [{}, {}, {}, { yAxis:1 }]
}
Set a custom range for the y-axis.
{
   yAxis: { min:100, max:420 }
}
Change y-axis to logarithmic scale.
{
   yAxis: { type:'logarithmic' }
}
Display y-axis on opposite (right) side.
{
   yAxis: { opposite:true }
}
Force y-axis labels to use 2 decimal points of precision.
{
   yAxis: { labels: { format:'{value:.2f}' } }
}
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'; } } }
}
Set dash style of grid lines (options include: Solid, ShortDash, ShortDot, ShortDashDot, ShortDashDotDot, Dot, Dash, LongDash, DashDot, LongDashDot, LongDashDotDot).
{
   yAxis: { gridLineDashStyle:'LongDashDot' }
}
Paint horizontal bands of color between every other grid line.
{
   yAxis: { alternateGridColor:'#F0F0F0' }
}
X-Axis Examples:
Description or enhancement Code for enhancement
Show vertical grid lines.
{
   xAxis: { startOnTick:true, endOnTick:true, gridLineWidth:1 }
}
Forcibly rotate x-axis labels (enter a rotation angle in degrees).
{
   xAxis: { labels: { rotation:-45 } }
}
Place a vertical line at a given date (months are 0 based thus the date in this example is June 1st, 2017).
{
   xAxis: { plotLines:[{ color:'#FF0000', width:2, value:Date.UTC(2017, 5, 1) }] }
}
Highlight a given date range (months are 0 based thus the dates in this example are July 1st, 2017 - September 30th, 2017).
{
   xAxis: { plotBands:[{ color:'#FCFFC5', from:Date.UTC(2017, 6, 1), to:Date.UTC(2017, 8, 30) }] }
}
Hide the x-axis.
{
   xAxis: { visible:false }
}
Miscellaneous Examples:
Description or enhancement Code for enhancement
Allow users to zoom display in the given dimension by dragging the mouse (valid dimemsions include: x, y or xy).
{
   chart: { zoomType: 'x' }
}
Set a list of colors used for the display's series. When all colors are used new colors will be pulled from the start again.
{
   colors: ['#7cb5ec', '#434348', '#90ed7d', '#f7a35c', '#8085e9', '#f15c80', '#e4d354', '#2b908f', '#f45b5b', '#91e8e1']
}
Style the display's border (setting borderWidth and borderRadios to 0 effectively disables the border).
{
   chart: { borderWidth:2, borderRadius:6, borderColor:'#666666' }
}
Point markers displayed only while hovering.
{
   plotOptions: { series: { marker: { enabled:false, states: { hover: { enabled:true } } } } }
}
Point markers displayed larger on hover (doesn't force point markers with lots of data).
{
   plotOptions: { series: { marker: { radius:3.5, states: { hover: { radius:7 } } } } }
}
Display labels showing stack totals when normal value stacking is enabled (best suited to column or bar displays).
{
   yAxis: { stackLabels: { enabled:true } }
}
Set abbreviations used to shorten large numbers in y-axis labels (symbols set as null causes full numbers to be shown).
{
   chart: { events: { load:function(){ Highcharts.setOptions({ lang: { numericSymbols:['Tho', 'Mil', 'Bil', 'Tri', 'Qud', 'Qun'] } }); this.redraw(); } } }
}