Я хочу, чтобы моя таблица раскрасила код столбца клиента, который ждал дольше всех, и поместила его в начало списка. Как только клиент получит помощь, он будет удален из списка, и следующий человек получит помощь. Я хотел бы покрасить столбцы красным для ожидания более 30 минут, желтым для 20 минут и зеленым для менее чем 19 минут. Я довольно новичок в кодировании и не могу заставить его работать. В сети ничего не могу найти.
function drawTable(Data) {
//create header
var data = new google.visualization.DataTable();
data.addColumn('string', "CustomerID");
data.addColumn('string', "Inserted Time");
data.addColumn('string', "VA Status");
data.addColumn('string', "Assign To");
//real data
var x = 0;
var y = 0;
for (var i = 0; i < Data.length; i++) {
data.addRows(1)
y = 0;
data.setCell(x, y, Data[i].CustomerID);
y++;
data.setCell(x, y, Data[i].InVATime);
y++;
data.setCell(x, y, Data[i].VerificationStatus);
y++;
data.setCell(x, y, Data[i].VAAgentName);
y++;
x++;
}
var table = new google.visualization.Table(document.getElementById('table_div'));
table.draw(data, { showRowNumber: false, width: '100%', height: '600', allowHtml: true, });
}
class Queue
{
// Array is used to implement a Queue
constructor()
{
this.items = [];
}
// enqueue function
enqueue(element)
{
// adding element to the queue
this.items.push(element);
}
// dequeue function
dequeue()
{
// removing element from the queue
// returns underflow when called
// on empty queue
if(this.isEmpty())
return "Underflow";
return this.items.shift();
}
// front function
front()
{
// returns the Front element of
// the queue without removing it.
if(this.isEmpty())
return "No elements in Queue";
return this.items[0];
}
isEmpty()
{
// return true if the queue is empty.
return this.items.length == 0;
}
Таблица работает, но ничего не в порядке. Как бы я реализовать это в Google Table?