Difference between revisions of "Widget Editor Theme Tab"

From dataZoa Wiki
Jump to: navigation, search
m
m
Line 30: Line 30:
 
</div>
 
</div>
  
==== Examples: ====
+
===== Legend Examples: =====
<div style="margin: 2em; margin-left: 6em;">
+
<div style="margin:2em; margin-left:6em;">
 
<table class="Gbb1" style="width:100%;font-size:smaller;">
 
<table class="Gbb1" style="width:100%;font-size:smaller;">
 
  <tr>
 
  <tr>
Line 37: Line 37:
 
   <td style="width:65%;font-size:larger;"><b>Code for enhancement</b></td>
 
   <td style="width:65%;font-size:larger;"><b>Code for enhancement</b></td>
 
  </tr>
 
  </tr>
<tr><td colspan="2"><b>Legend</b></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 59: Line 58:
 
   </td>
 
   </td>
 
  </tr>
 
  </tr>
  <tr><td colspan="2"><b>Tooltip</b></td></tr>
+
</table>
 +
</div>
 +
 
 +
 
 +
===== Tooltip Examples: =====
 +
<div style="margin:2em; margin-left:6em;">
 +
<table class="Gbb1" style="width:100%;font-size:smaller;">
 +
  <tr>
 +
  <td style="width:35%;font-size:larger;"><b>Description or enhancement</b></td>
 +
  <td style="width:65%;font-size:larger;"><b>Code for enhancement</b></td>
 +
</tr>
 
  <tr><td>Enable crosshairs on hover for: <i>[x-axis, y-axis]</i></td>
 
  <tr><td>Enable crosshairs on hover for: <i>[x-axis, y-axis]</i></td>
 
   <td>
 
   <td>
Line 88: Line 97:
 
   </td>
 
   </td>
 
  </tr>
 
  </tr>
  <tr><td colspan="2"><b>Point Markers</b></td></tr>
+
</table>
 +
</div>
 +
 
 +
 
 +
===== Point Marker Examples: =====
 +
<div style="margin:2em; margin-left:6em;">
 +
<table class="Gbb1" style="width:100%;font-size:smaller;">
 +
  <tr>
 +
  <td style="width:35%;font-size:larger;"><b>Description or enhancement</b></td>
 +
  <td style="width:65%;font-size:larger;"><b>Code for enhancement</b></td>
 +
</tr>
 
  <tr><td>Point markers displayed only while hovering.</td>
 
  <tr><td>Point markers displayed only while hovering.</td>
 
   <td>
 
   <td>
Line 103: Line 122:
 
   </td>
 
   </td>
 
  </tr>
 
  </tr>
  <tr><td colspan="2"><b>Y-Axis</b></td></tr>
+
</table>
 +
</div>
 +
 
 +
 
 +
===== Y-Axis Examples: =====
 +
<div style="margin:2em; margin-left:6em;">
 +
<table class="Gbb1" style="width:100%;font-size:smaller;">
 +
  <tr>
 +
  <td style="width:35%;font-size:larger;"><b>Description or enhancement</b></td>
 +
  <td style="width:65%;font-size:larger;"><b>Code for enhancement</b></td>
 +
</tr>
 
  <tr><td>Change y-axis to logarithmic scale.</td>
 
  <tr><td>Change y-axis to logarithmic scale.</td>
 
   <td>
 
   <td>
Line 146: Line 175:
 
   </td>
 
   </td>
 
  </tr>
 
  </tr>
  <tr><td colspan="2"><b>X-Axis</b></td></tr>
+
</table>
 +
</div>
 +
 
 +
 
 +
===== X-Axis Examples: =====
 +
<div style="margin:2em; margin-left:6em;">
 +
<table class="Gbb1" style="width:100%;font-size:smaller;">
 +
  <tr>
 +
  <td style="width:35%;font-size:larger;"><b>Description or enhancement</b></td>
 +
  <td style="width:65%;font-size:larger;"><b>Code for enhancement</b></td>
 +
</tr>
 
  <tr><td>Show vertical grid lines.</td>
 
  <tr><td>Show vertical grid lines.</td>
 
   <td>
 
   <td>

Revision as of 09:03, 12 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

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.
Legend 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' }
}
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; } } } } }
}


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 = 2 digit year, %Y = 4 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 }
}


Point Marker Examples:
Description or enhancement Code for enhancement
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 } } } } }
}


Y-Axis Examples:
Description or enhancement Code for enhancement
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'; } } }
}
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 }
}
Hide the x-axis.
{
   xAxis: { visible:false }
}