mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-23 13:44:59 +05:00
156 lines
6.3 KiB
JavaScript
156 lines
6.3 KiB
JavaScript
/**
|
|
* Default configuration settings
|
|
*/
|
|
getDefaults = function () {
|
|
return {
|
|
// Settings common to most/all chart types
|
|
common: {
|
|
type: 'line',
|
|
lineColor: '#00f',
|
|
fillColor: '#cdf',
|
|
defaultPixelsPerValue: 3,
|
|
width: 'auto',
|
|
height: 'auto',
|
|
composite: false,
|
|
tagValuesAttribute: 'values',
|
|
tagOptionsPrefix: 'spark',
|
|
enableTagOptions: false,
|
|
enableHighlight: true,
|
|
highlightLighten: 1.4,
|
|
tooltipSkipNull: true,
|
|
tooltipPrefix: '',
|
|
tooltipSuffix: '',
|
|
disableHiddenCheck: false,
|
|
numberFormatter: false,
|
|
numberDigitGroupCount: 3,
|
|
numberDigitGroupSep: ',',
|
|
numberDecimalMark: '.',
|
|
disableTooltips: false,
|
|
disableInteraction: false
|
|
},
|
|
// Defaults for line charts
|
|
line: {
|
|
spotColor: '#f80',
|
|
highlightSpotColor: '#5f5',
|
|
highlightLineColor: '#f22',
|
|
spotRadius: 1.5,
|
|
minSpotColor: '#f80',
|
|
maxSpotColor: '#f80',
|
|
lineWidth: 1,
|
|
normalRangeMin: undefined,
|
|
normalRangeMax: undefined,
|
|
normalRangeColor: '#ccc',
|
|
drawNormalOnTop: false,
|
|
chartRangeMin: undefined,
|
|
chartRangeMax: undefined,
|
|
chartRangeMinX: undefined,
|
|
chartRangeMaxX: undefined,
|
|
tooltipFormat: new SPFormat('<span style="color: {{color}}">●</span> {{prefix}}{{y}}{{suffix}}')
|
|
},
|
|
// Defaults for bar charts
|
|
bar: {
|
|
barColor: '#3366cc',
|
|
negBarColor: '#f44',
|
|
stackedBarColor: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00',
|
|
'#dd4477', '#0099c6', '#990099'],
|
|
zeroColor: undefined,
|
|
nullColor: undefined,
|
|
zeroAxis: true,
|
|
barWidth: 4,
|
|
barSpacing: 1,
|
|
chartRangeMax: undefined,
|
|
chartRangeMin: undefined,
|
|
chartRangeClip: false,
|
|
colorMap: undefined,
|
|
tooltipFormat: new SPFormat('<span style="color: {{color}}">●</span> {{prefix}}{{value}}{{suffix}}')
|
|
},
|
|
// Defaults for tristate charts
|
|
tristate: {
|
|
barWidth: 4,
|
|
barSpacing: 1,
|
|
posBarColor: '#6f6',
|
|
negBarColor: '#f44',
|
|
zeroBarColor: '#999',
|
|
colorMap: {},
|
|
tooltipFormat: new SPFormat('<span style="color: {{color}}">●</span> {{value:map}}'),
|
|
tooltipValueLookups: { map: { '-1': 'Loss', '0': 'Draw', '1': 'Win' } }
|
|
},
|
|
// Defaults for discrete charts
|
|
discrete: {
|
|
lineHeight: 'auto',
|
|
thresholdColor: undefined,
|
|
thresholdValue: 0,
|
|
chartRangeMax: undefined,
|
|
chartRangeMin: undefined,
|
|
chartRangeClip: false,
|
|
tooltipFormat: new SPFormat('{{prefix}}{{value}}{{suffix}}')
|
|
},
|
|
// Defaults for bullet charts
|
|
bullet: {
|
|
targetColor: '#f33',
|
|
targetWidth: 3, // width of the target bar in pixels
|
|
performanceColor: '#33f',
|
|
rangeColors: ['#d3dafe', '#a8b6ff', '#7f94ff'],
|
|
base: undefined, // set this to a number to change the base start number
|
|
tooltipFormat: new SPFormat('{{fieldkey:fields}} - {{value}}'),
|
|
tooltipValueLookups: { fields: {r: 'Range', p: 'Performance', t: 'Target'} }
|
|
},
|
|
// Defaults for pie charts
|
|
pie: {
|
|
offset: 0,
|
|
sliceColors: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00',
|
|
'#dd4477', '#0099c6', '#990099'],
|
|
borderWidth: 0,
|
|
borderColor: '#000',
|
|
tooltipFormat: new SPFormat('<span style="color: {{color}}">●</span> {{value}} ({{percent.1}}%)')
|
|
},
|
|
// Defaults for box plots
|
|
box: {
|
|
raw: false,
|
|
boxLineColor: '#000',
|
|
boxFillColor: '#cdf',
|
|
whiskerColor: '#000',
|
|
outlierLineColor: '#333',
|
|
outlierFillColor: '#fff',
|
|
medianColor: '#f00',
|
|
showOutliers: true,
|
|
outlierIQR: 1.5,
|
|
spotRadius: 1.5,
|
|
target: undefined,
|
|
targetColor: '#4a2',
|
|
chartRangeMax: undefined,
|
|
chartRangeMin: undefined,
|
|
tooltipFormat: new SPFormat('{{field:fields}}: {{value}}'),
|
|
tooltipFormatFieldlistKey: 'field',
|
|
tooltipValueLookups: { fields: { lq: 'Lower Quartile', med: 'Median',
|
|
uq: 'Upper Quartile', lo: 'Left Outlier', ro: 'Right Outlier',
|
|
lw: 'Left Whisker', rw: 'Right Whisker'} }
|
|
}
|
|
};
|
|
};
|
|
|
|
// You can have tooltips use a css class other than jqstooltip by specifying tooltipClassname
|
|
defaultStyles = '.jqstooltip { ' +
|
|
'position: absolute;' +
|
|
'left: 0px;' +
|
|
'top: 0px;' +
|
|
'visibility: hidden;' +
|
|
'background: rgb(0, 0, 0) transparent;' +
|
|
'background-color: rgba(0,0,0,0.6);' +
|
|
'filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);' +
|
|
'-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";' +
|
|
'color: white;' +
|
|
'font: 10px arial, san serif;' +
|
|
'text-align: left;' +
|
|
'white-space: nowrap;' +
|
|
'padding: 5px;' +
|
|
'border: 1px solid white;' +
|
|
'box-sizing: content-box;' +
|
|
'z-index: 10000;' +
|
|
'}' +
|
|
'.jqsfield { ' +
|
|
'color: white;' +
|
|
'font: 10px arial, san serif;' +
|
|
'text-align: left;' +
|
|
'}';
|
|
|