Commit c3b8d363 authored by prumde's avatar prumde

Changes for SUN CHC KPI Dashboard

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@217000 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cf769e20
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
}, },
{ {
id: "GREEN", id: "GREEN",
expression: " 81 < data[0] ", expression: " 81 <= data[0] ",
colors: [[0, 199, 153], [248, 248, 248]] colors: [[0, 199, 153], [248, 248, 248]]
} }
] ]
...@@ -155,9 +155,11 @@ ...@@ -155,9 +155,11 @@
tooltips: { tooltips: {
callbacks: { callbacks: {
label: function(tooltipItem, data) { label: function(tooltipItem, data) {
console.log('tooltipItem', tooltipItem, data.datasets[0].dataSource) ; //console.log('tooltipItem', tooltipItem, data) ;
var currentYear = (data.datasets[0].dataSource == 'YTD') ? ' ' : ' ' + new Date().getFullYear();
var label = tooltipItem.yLabel + ' Calls on ' + tooltipItem.xLabel + ' 2020 ' + data.datasets[0].dataSource; var labelTxt = (data.datasets[0].dataSource == 'YTD') ? ' Calls in ' : ' Calls on ';
//var label = tooltipItem.yLabel + ' Calls on ' + tooltipItem.xLabel + ' 2020 ';
var label = tooltipItem.yLabel + labelTxt + tooltipItem.xLabel + currentYear;
return label; return label;
}, },
title: function(tooltipItem, data) { title: function(tooltipItem, data) {
...@@ -182,21 +184,21 @@ ...@@ -182,21 +184,21 @@
return label; return label;
} }
}, },
fontSize: 8 fontSize: 7
} }
} }
], ],
yAxes: [ yAxes: [
{ {
ticks: { ticks: {
callback: function( label, index, labels ) { fontSize: 10,
if ( /\s/.test( label ) ) { beginAtZero: true,
return label.split( " " ); min: 0,
} else { callback: function(value, index, values) {
return label; if (Math.floor(value) === value) {
return value;
}
} }
},
fontSize: 10
} }
} }
] ]
...@@ -257,7 +259,7 @@ ...@@ -257,7 +259,7 @@
x_column: 'X_VALUE', x_column: 'X_VALUE',
x_column_label: 'Duration', x_column_label: 'Duration',
y_column: 'ACTUAL_VALUE', y_column: 'ACTUAL_VALUE',
y_column_label: 'Orders', y_column_label: 'Orders ( in \u20B9 )',
datasets: [ datasets: [
{ {
fill: true, fill: true,
...@@ -278,8 +280,11 @@ ...@@ -278,8 +280,11 @@
tooltips: { tooltips: {
callbacks: { callbacks: {
label: function(tooltipItem, data) { label: function(tooltipItem, data) {
console.log('tooltipItem', tooltipItem, data) ; //console.log('tooltipItem', tooltipItem, data) ;
var label = tooltipItem.yLabel + ' Orders on ' + tooltipItem.xLabel + ' 2020 '; var currentYear = (data.datasets[0].dataSource == 'YTD') ? ' ' : ' ' + new Date().getFullYear();
var labelTxt = (data.datasets[0].dataSource == 'YTD') ? ' Orders in ' : ' Orders on ';
//var label = tooltipItem.yLabel + ' Orders on ' + tooltipItem.xLabel + ' 2020 ';
var label = '\u20B9 ' + tooltipItem.yLabel + labelTxt + tooltipItem.xLabel + currentYear;
return label; return label;
}, },
title: function(tooltipItem, data) { title: function(tooltipItem, data) {
...@@ -304,21 +309,21 @@ ...@@ -304,21 +309,21 @@
return label; return label;
} }
}, },
fontSize: 8 fontSize: 7
} }
} }
], ],
yAxes: [ yAxes: [
{ {
ticks: { ticks: {
callback: function( label, index, labels ) { fontSize: 10,
if ( /\s/.test( label ) ) { beginAtZero: true,
return label.split( " " ); min: 0,
} else { callback: function(value, index, values) {
return label; if (Math.floor(value) === value) {
return value;
}
} }
},
fontSize: 10
} }
} }
] ]
...@@ -398,8 +403,11 @@ ...@@ -398,8 +403,11 @@
tooltips: { tooltips: {
callbacks: { callbacks: {
label: function(tooltipItem, data) { label: function(tooltipItem, data) {
console.log('tooltipItem', tooltipItem, data) ; //console.log('tooltipItem', tooltipItem, data) ;
var label = tooltipItem.yLabel + ' Items on ' + tooltipItem.xLabel + ' 2020 '; var currentYear = (data.datasets[0].dataSource == 'YTD') ? ' ' : ' ' + new Date().getFullYear();
var labelTxt = (data.datasets[0].dataSource == 'YTD') ? ' Items in ' : ' Items on ';
//var label = tooltipItem.yLabel + ' Items on ' + tooltipItem.xLabel + ' 2020 ';
var label = tooltipItem.yLabel + labelTxt + tooltipItem.xLabel + currentYear;
return label; return label;
}, },
title: function(tooltipItem, data) { title: function(tooltipItem, data) {
...@@ -424,21 +432,21 @@ ...@@ -424,21 +432,21 @@
return label; return label;
} }
}, },
fontSize: 8 fontSize: 7
} }
} }
], ],
yAxes: [ yAxes: [
{ {
ticks: { ticks: {
callback: function( label, index, labels ) { fontSize: 10,
if ( /\s/.test( label ) ) { beginAtZero: true,
return label.split( " " ); min: 0,
} else { callback: function(value, index, values) {
return label; if (Math.floor(value) === value) {
return value;
}
} }
},
fontSize: 10
} }
} }
] ]
...@@ -476,12 +484,9 @@ ...@@ -476,12 +484,9 @@
charts_config: { charts_config: {
image: 'total_calls.svg', image: 'total_calls.svg',
title_column: 'Total Calls', title_column: 'Total Calls',
theme : 'violet' theme : 'violet',
},
chart_properties: {
chartType: 'percentage',
labels: [''],
options: { options: {
percentFactorColumn: 'TARGET_VALUE',
animateScale: true, animateScale: true,
animateRotate: true, animateRotate: true,
width: 114, width: 114,
...@@ -505,7 +510,7 @@ ...@@ -505,7 +510,7 @@
}, },
{ {
id: "GREEN", id: "GREEN",
expression: " 81 < data[0] ", expression: " 81 <= data[0] ",
colors: [[0, 199, 153], [248, 248, 248]] colors: [[0, 199, 153], [248, 248, 248]]
} }
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment