use custom styles for the form timeline, move away from charts.css
parent
25a3359671
commit
4810d6b5ba
|
@ -1,4 +1,58 @@
|
|||
.charts_main() {
|
||||
|
||||
// basic functional things
|
||||
table.cp-charts.column {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
overflow-x: auto;
|
||||
tbody {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
min-width: 100%;
|
||||
|
||||
tr {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
|
||||
flex-direction: row;
|
||||
flex-shrink: 1;
|
||||
flex-grow: 1;
|
||||
justify-content: flex-start;
|
||||
|
||||
align-items: flex-end;
|
||||
|
||||
td {
|
||||
display: flex;
|
||||
height: calc(100% * var(--size));
|
||||
align-items: flex-start;
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// styles
|
||||
table.cp-charts.column {
|
||||
//border: 1px solid white;
|
||||
tbody {
|
||||
tr {
|
||||
max-width: 30px;
|
||||
|
||||
td {
|
||||
min-width: 3px;
|
||||
border: 1px solid @cryptpad_color_brand;
|
||||
background: @cryptpad_color_brand;
|
||||
margin: 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
&.bar {
|
||||
th {
|
||||
//width: 200px !important;
|
||||
|
|
|
@ -69,6 +69,12 @@
|
|||
justify-content: center;
|
||||
min-width: 300px;
|
||||
|
||||
div.timeline-container {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
/*
|
||||
table.cp-chart-table {
|
||||
|
||||
--color: @colortheme_apps[pad];
|
||||
|
@ -107,6 +113,7 @@
|
|||
color: transparent;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
.cp-form-input-block {
|
||||
display: flex;
|
||||
|
@ -838,8 +845,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
.charts-css {
|
||||
.charts_main();
|
||||
}
|
||||
.charts_main();
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ define([
|
|||
'css!/bower_components/codemirror/addon/dialog/dialog.css',
|
||||
'css!/bower_components/codemirror/addon/fold/foldgutter.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',
|
||||
'less!/form/app-form.less',
|
||||
], function (
|
||||
|
@ -1910,27 +1910,29 @@ define([
|
|||
var max_day = arrayMax(times);
|
||||
var days = getDayArray(new Date(min_day), new Date(max_day));
|
||||
|
||||
return Charts.table(h('tbody', days.map(function (time) {
|
||||
var count = tally[time] || 0;
|
||||
var percent = count / max_count;
|
||||
var date = new Date(time).toLocaleDateString();
|
||||
if (days.length < 2) { return; }
|
||||
|
||||
var bar = h('td.cp-bar', {
|
||||
style: '--size: ' + Number(percent).toFixed(2),
|
||||
"data-tippy-placement": "top",
|
||||
title: Messages._getKey('form_timelineLabel', [date, count])
|
||||
});
|
||||
var dateEl = h('th', { scope: "row" }, date);
|
||||
return h('div.timeline-container', {
|
||||
//style: 'width: 100%; height: 200px;',
|
||||
|
||||
return h('tr', bar, dateEl );
|
||||
})), [
|
||||
"charts-css",
|
||||
"cp-chart-table",
|
||||
"column",
|
||||
//"data-spacing-2",
|
||||
//"show-labels",
|
||||
//"labels-align-center"
|
||||
]);
|
||||
|
||||
}, h('table.cp-charts.column.cp-chart-timeline.cp-chart-table',
|
||||
h('tbody', days.map(function (time) {
|
||||
var count = tally[time] || 0;
|
||||
var percent = count / max_count;
|
||||
var date = new Date(time).toLocaleDateString();
|
||||
|
||||
var bar = h('td', {
|
||||
style: '--size: ' + Number(percent).toFixed(2),
|
||||
//"data-tippy-placement": "top",
|
||||
title: Messages._getKey('form_timelineLabel', [date, count])
|
||||
});
|
||||
//var dateEl = h('th', { scope: "row" }, date);
|
||||
|
||||
return h('tr', bar/* dateEl*/ );
|
||||
}))
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
var renderResults = APP.renderResults = function (content, answers, showUser) {
|
||||
|
|
Loading…
Reference in New Issue