/* defined datas */
var dataTargetProfit = [
	[1354586000000, 153],
	[1364587000000, 658],
	[1374588000000, 198],
	[1384589000000, 663],
	[1394590000000, 801],
	[1404591000000, 1080],
	[1414592000000, 500],
	[1424593000000, 749],
	[1434594000000, 523],
	[1444595000000, 258],
	[1454596000000, 688],
	[1464597000000, 364]
]
var dataProfit = [
	[1354586000000, 53],
	[1364587000000, 65],
	[1374588000000, 98],
	[1384589000000, 83],
	[1394590000000, 980],
	[1404591000000, 808],
	[1414592000000, 720],
	[1424593000000, 674],
	[1434594000000, 23],
	[1444595000000, 79],
	[1454596000000, 88],
	[1464597000000, 36]
]
var dataSignups = [
	[1354586000000, 647],
	[1364587000000, 435],
	[1374588000000, 784],
	[1384589000000, 346],
	[1394590000000, 487],
	[1404591000000, 463],
	[1414592000000, 479],
	[1424593000000, 236],
	[1434594000000, 843],
	[1444595000000, 657],
	[1454596000000, 241],
	[1464597000000, 341]
]
var dataSet1 = [
	[0, 10],
	[100, 8],
	[200, 7],
	[300, 5],
	[400, 4],
	[500, 6],
	[600, 3],
	[700, 2]
];
var dataSet2 = [
	[0, 9],
	[100, 6],
	[200, 5],
	[300, 3],
	[400, 3],
	[500, 5],
	[600, 2],
	[700, 1]
];


$(document).ready(function () {

	/* init datatables */
	$('#dt-basic-tabel').dataTable(
	{
		responsive: true,
		dom:
			"<'row mb-3'<'col-sm-12 col-md-6 d-flex align-items-center justify-content-start'f>>" +
			"<'row'<'col-sm-12'tr>>" +
			"<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
		buttons: [
			{
                extend: 'pdfHtml5',
                text: 'PDF',
                titleAttr: 'Generate PDF',
                className: 'btn-outline-danger btn-sm mr-1'
            },
            {
                extend: 'excelHtml5',
                text: 'Excel',
                titleAttr: 'Generate Excel',
                className: 'btn-outline-success btn-sm mr-1'
            },
			{
				extend: 'colvis',
				text: 'Column Visibility',
				titleAttr: 'Col visibility',
				className: 'btn-outline-default'
			},
			{
				extend: 'csvHtml5',
				text: 'CSV',
				titleAttr: 'Generate CSV',
				className: 'btn-outline-default'
			},
			{
				extend: 'copyHtml5',
				text: 'Copy',
				titleAttr: 'Copy to clipboard',
				className: 'btn-outline-default'
			},
			{
				extend: 'print',
				text: '<i class="fal fa-print"></i>',
				titleAttr: 'Print Table',
				className: 'btn-outline-default'
			}

		],
		columnDefs: [
			{
				// targets: -1,
				title: 'Action',
				orderable: false,
				render: function(data, type, full, meta)
				{

					/*
					-- ES6
					-- convert using https://babeljs.io online transpiler
					return `
					<a href='javascript:void(0);' class='btn btn-sm btn-icon btn-outline-danger rounded-circle mr-1' title='Delete Record'>
						<i class="fal fa-times"></i>
					</a>
					<div class='dropdown d-inline-block dropleft '>
						<a href='#'' class='btn btn-sm btn-icon btn-outline-primary rounded-circle shadow-0' data-toggle='dropdown' aria-expanded='true' title='More options'>
							<i class="fal fa-ellipsis-v"></i>
						</a>
						<div class='dropdown-menu'>
							<a class='dropdown-item' href='javascript:void(0);'>Change Status</a>
							<a class='dropdown-item' href='javascript:void(0);'>Generate Report</a>
						</div>
					</div>`;
						
					ES5 example below:	

					*/
					return "\n\t\t\t\t\t\t<a href='javascript:void(0);' class='btn btn-sm btn-icon btn-outline-danger rounded-circle mr-1' title='Delete Record'>\n\t\t\t\t\t\t\t<i class=\"fal fa-times\"></i>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<div class='dropdown d-inline-block dropleft'>\n\t\t\t\t\t\t\t<a href='#'' class='btn btn-sm btn-icon btn-outline-primary rounded-circle shadow-0' data-toggle='dropdown' aria-expanded='true' title='More options'>\n\t\t\t\t\t\t\t\t<i class=\"fal fa-ellipsis-v\"></i>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<div class='dropdown-menu'>\n\t\t\t\t\t\t\t\t<a class='dropdown-item' href='javascript:void(0);'>Change Status</a>\n\t\t\t\t\t\t\t\t<a class='dropdown-item' href='javascript:void(0);'>Generate Report</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>";
				},
			},
			
		]

	});




});