Chart.ChartToolbar
Defines chart toolbar.
Sample configuration:
var toolbarConfig = {
visibility: 'auto',
resetZoomTooltipText: 'Reset Zoom (100%)',
zoomingTooltipText: 'Zoom in to selection area',
panningTooltipText: 'Pan the chart',
resetZoomButtonVisible: true,
zoomingButtonVisible: true,
panningButtonVisible: true
}
Example usage:
function addDays(date, value) {
var newDate = new Date(date.getTime());
newDate.setDate(date.getDate() + value);
return newDate;
}
function round(d) {
return Math.round(100 * d) / 100;
}
var data1 = [];
var data2 = [];
var yValue1 = 50;
var yValue2 = 200;
var date = new Date(2010, 0, 1);
for (var i = 0; i < 200; i++) {
yValue1 += Math.random() * 10 - 5;
data1.push([date, round(yValue1)]);
yValue2 += Math.random() * 10 - 5;
data2.push([date, round(yValue2)]);
date = addDays(date, 1);
}
$(document).ready(function () {
$('#selector').jqChart({
title: 'Chart Toolbar',
toolbar: {
visibility: 'auto', // auto, visible, hidden
resetZoomTooltipText: 'Reset Zoom (100%)',
zoomingTooltipText: 'Zoom in to selection area',
panningTooltipText: 'Pan the chart'
},
mouseInteractionMode: 'zooming', // zooming, panning
axes: [
{
type: 'dateTime',
location: 'bottom',
zoomEnabled: true
},
{
type: 'linear',
location: 'left',
zoomEnabled: true
}
],
series: [
{
type: 'line',
data: data1,
markers: null
},
{
type: 'line',
data: data2,
markers: null
}
]
}
}
Defined By
Config options
Specifies the toolbar horizontal alignment - 'left', 'center' or 'right'. ...
Specifies the toolbar horizontal alignment - 'left', 'center' or 'right'.
Defaults to: 'right'
Specifies whether or not the " panning" button is visible. ...
Specifies whether or not the " panning" button is visible.
Defaults to: true
Specifies panning button tooltip text. ...
Specifies panning button tooltip text.
Defaults to: 'Pan the chart'
Specifies whether or not the "reset zoom" button is visible. ...
Specifies whether or not the "reset zoom" button is visible.
Defaults to: true
Specifies reset zoom button tooltip text. ...
Specifies reset zoom button tooltip text.
Defaults to: 'Reset Zoom (100%)'
Specifies the toolbar vertical alignment - 'top', 'center' or 'bottom'. ...
Specifies the toolbar vertical alignment - 'top', 'center' or 'bottom'.
Defaults to: 'top'
Specifies the chart toolbar visibility - 'auto', 'visible' or 'hidden'. ...
Specifies the chart toolbar visibility - 'auto', 'visible' or 'hidden'.
Defaults to: 'auto'
Specifies whether or not the "zooming" button is visible. ...
Specifies whether or not the "zooming" button is visible.
Defaults to: true