|
|
@ -38,7 +38,7 @@ define([
|
|
|
|
'css!/bower_components/codemirror/addon/dialog/dialog.css',
|
|
|
|
'css!/bower_components/codemirror/addon/dialog/dialog.css',
|
|
|
|
'css!/bower_components/codemirror/addon/fold/foldgutter.css',
|
|
|
|
'css!/bower_components/codemirror/addon/fold/foldgutter.css',
|
|
|
|
'css!/lib/datepicker/flatpickr.min.css',
|
|
|
|
'css!/lib/datepicker/flatpickr.min.css',
|
|
|
|
'css!/lib/chart/charts.min.css',
|
|
|
|
//'css!/lib/chart/charts.min.css',
|
|
|
|
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
|
|
|
|
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
|
|
|
|
'less!/form/app-form.less',
|
|
|
|
'less!/form/app-form.less',
|
|
|
|
], function (
|
|
|
|
], function (
|
|
|
@ -1910,27 +1910,29 @@ define([
|
|
|
|
var max_day = arrayMax(times);
|
|
|
|
var max_day = arrayMax(times);
|
|
|
|
var days = getDayArray(new Date(min_day), new Date(max_day));
|
|
|
|
var days = getDayArray(new Date(min_day), new Date(max_day));
|
|
|
|
|
|
|
|
|
|
|
|
return Charts.table(h('tbody', days.map(function (time) {
|
|
|
|
if (days.length < 2) { return; }
|
|
|
|
var count = tally[time] || 0;
|
|
|
|
|
|
|
|
var percent = count / max_count;
|
|
|
|
|
|
|
|
var date = new Date(time).toLocaleDateString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var bar = h('td.cp-bar', {
|
|
|
|
return h('div.timeline-container', {
|
|
|
|
style: '--size: ' + Number(percent).toFixed(2),
|
|
|
|
//style: 'width: 100%; height: 200px;',
|
|
|
|
"data-tippy-placement": "top",
|
|
|
|
|
|
|
|
title: Messages._getKey('form_timelineLabel', [date, count])
|
|
|
|
|
|
|
|
});
|
|
|
|
}, h('table.cp-charts.column.cp-chart-timeline.cp-chart-table',
|
|
|
|
var dateEl = h('th', { scope: "row" }, date);
|
|
|
|
h('tbody', days.map(function (time) {
|
|
|
|
|
|
|
|
var count = tally[time] || 0;
|
|
|
|
return h('tr', bar, dateEl );
|
|
|
|
var percent = count / max_count;
|
|
|
|
})), [
|
|
|
|
var date = new Date(time).toLocaleDateString();
|
|
|
|
"charts-css",
|
|
|
|
|
|
|
|
"cp-chart-table",
|
|
|
|
var bar = h('td', {
|
|
|
|
"column",
|
|
|
|
style: '--size: ' + Number(percent).toFixed(2),
|
|
|
|
//"data-spacing-2",
|
|
|
|
//"data-tippy-placement": "top",
|
|
|
|
//"show-labels",
|
|
|
|
title: Messages._getKey('form_timelineLabel', [date, count])
|
|
|
|
//"labels-align-center"
|
|
|
|
});
|
|
|
|
]);
|
|
|
|
//var dateEl = h('th', { scope: "row" }, date);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return h('tr', bar/* dateEl*/ );
|
|
|
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var renderResults = APP.renderResults = function (content, answers, showUser) {
|
|
|
|
var renderResults = APP.renderResults = function (content, answers, showUser) {
|
|
|
|