I have been experimenting with the horizontal bar RGraph demo using this code and have found it to be very successful:
let newData = [1, 40, 30];
let hBarChart = new RGraph.HBar('myCanvas', newData);
hBarChart.Set('chart.labels', ['Richard', 'Alex', 'Nick']);
hBarChart.Set('chart.background.barcolor1', 'white');
hBarChart.Set('chart.background.barcolor2', 'white');
hBarChart.Set('chart.background.grid', true);
hBarChart.Set('chart.colors', ['red']);
hBarChart.Draw();
I am wondering if there is a way to incorporate Date
objects instead of numbers. I attempted to use something like this but was unsuccessful:
let newData = [new Date(1000), new Date(2000), new Date(3000)];