{{THEME}}
var header_logo_image = '{{THEME:header.logo}}';
var header_logo_big_image = '{{THEME:header.logobig}}';

var app_root_url = '{{APPROOTURL}}';
var api_url_path = '{{APIURLPATH}}';

window.chartColors = {
	red: 'rgb(255, 99, 132)',
	orange: 'rgb(255, 159, 64)',
	yellow: 'rgb(255, 205, 86)',
	green: 'rgb(75, 192, 192)',
	blue: 'rgb(54, 162, 235)',
	purple: 'rgb(153, 102, 255)',
	grey: 'rgb(201, 203, 207)'
};

var dashboard_chart_config = {
	type: 'doughnut',
	data: {
		datasets: [{
			data: [
				{{DBDTCOUNT:registry_expiry < [TODAY+60]}},
				{{DBDTCOUNT:registry_expiry is NULL AND status NOT LIKE '%Not Registered%'}},
				{{DBDTCOUNT:primary_whois_checked_at is NULL OR primary_whois_checked_at < [TODAY-180]}},
				{{DBDTCOUNT:}}
			],
			backgroundColor: [
				window.chartColors.red,
				window.chartColors.orange,
				window.chartColors.yellow,
				window.chartColors.green
			],
			label: 'Dataset 1'
		}],
		labels: [
			'Expiring soon',
			'Missing Expiry Date',
			'Not Checked',
			'Other'
		]
	},
	options: {
		responsive: true,
		legend: {
			position: 'right'
		},
		title: {
			display: true,
			text: ''
		},
		animation: {
			animateScale: false,
			animateRotate: false
		}
	}
};	

document.addEventListener('DOMContentLoaded', function() {
    var total = dashboard_chart_config['data']['datasets'][0]['data'][3];
	var rest = dashboard_chart_config['data']['datasets'][0]['data'][0];
	rest += dashboard_chart_config['data']['datasets'][0]['data'][1];
	//rest += dashboard_chart_config['data']['datasets'][0]['data'][2];
	dashboard_chart_config['data']['datasets'][0]['data'][3] = total - rest;
}, false);

{{USERINFOJS}}
