I'm using crossfilter and dc.js, let's consider this dataSet :
var dataSet = [{Day:"1", Time:"1230", Score:"30"}, // Monday at 12:30
{Day:"1", Time:"0830", Score:"20"},// Monday at 08:30
{Day:"1", Time:"0900", Score:"35"},
{Day:"1", Time:"2330", Score:"40"},
{Day:"1", Time:"0450", Score:"15"},
{Day:"1", Time:"1830", Score:"35"},
{Day:"2", Time:"0630", Score:"30"},// Tuesday at 06:30
{Day:"2", Time:"0230", Score:"40"},//Tuesday at 02:30
{Day:"2", Time:"1910", Score:"35"},
{Day:"2", Time:"2130", Score:"35"},
{Day:"2", Time:"2000", Score:"20"},
{Day:"2", Time:"0725", Score:"15"},
{Day:"3", Time:"2210", Score:"30"}, // Wenesday at 22:10
{Day:"3", Time:"1450", Score:"40"},// Wenesday at 14:50
{Day:"3", Time:"0515", Score:"45"},
{Day:"3", Time:"0930", Score:"30"},
{Day:"3", Time:"1100", Score:"40"},
{Day:"3", Time:"1230", Score:"35"},
{Day:"4", Time:"1810", Score:"30"}, // Thursday at 18:10
{Day:"4", Time:"1050", Score:"40"},// Thursday at 10:50
{Day:"4", Time:"0515", Score:"45"},
{Day:"4", Time:"0930", Score:"30"},
{Day:"4", Time:"1100", Score:"40"},
{Day:"4", Time:"1230", Score:"35"},
{Day:"5", Time:"2210", Score:"30"}, // Friday at 22:10
{Day:"5", Time:"1450", Score:"40"},// Friday at 14:50
{Day:"5", Time:"0515", Score:"40"},
{Day:"5", Time:"0930", Score:"45"},
{Day:"5", Time:"1100", Score:"40"},
{Day:"5", Time:"1230", Score:"35"},
{Day:"6", Time:"2100", Score:"30"}, // Saturday at 21:00
{Day:"6", Time:"0550", Score:"40"},// Saturday at 05:50
{Day:"6", Time:"0515", Score:"45"},
{Day:"6", Time:"0930", Score:"30"},
{Day:"6", Time:"1100", Score:"40"},
{Day:"6", Time:"1230", Score:"35"},
{Day:"7", Time:"2210", Score:"40"}, // Sunday at 22:10
{Day:"7", Time:"1150", Score:"35"},// Sunday at 11:50
{Day:"7", Time:"0515", Score:"45"},
{Day:"7", Time:"0930", Score:"30"},
{Day:"7", Time:"1100", Score:"40"},
{Day:"7", Time:"1230", Score:"20"}
];
As you can see, I have a typical week, from 1 to 7 ( Monday to Sunday ).
And I want make a barChart where I can see the scores by day and time.
X-axis : The week days, from Monday to Sunday, and each day fragmented in
24 hours from 00 to 24
Y-axis : The score's values
For that I must create a time dimension, I tried this but without nice result :
var timeFormatweek = d3.time.format("%w%H%M");
d.timeweek = timeFormatweek.parse(d.Day+Time);
But this return always Monday, even if my d.Day change. And for the scale of the chart and don't now how to proceed.