Difference between revisions of "Widget Editor Theme Tab"

From dataZoa Wiki
Jump to: navigation, search
m (X-Axis Examples:)
m
Line 261: Line 261:
 
</table>
 
</table>
 
</div>
 
</div>
 +
 +
[[Category:Advanced]][[Category:Displays]][[Category:Editing]][[Category:Examples]][[Category:How_To]]

Revision as of 07:44, 13 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.


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' }
}


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 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; } } } } }
}


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