Merge pull request #17 from jakob-stoeck/patch-1
show 7 days per week in docs, fixes #12
This commit is contained in:
commit
008d1f376b
2
dist/frappe-charts.min.js
vendored
2
dist/frappe-charts.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/frappe-charts.min.js.map
vendored
2
dist/frappe-charts.min.js.map
vendored
File diff suppressed because one or more lines are too long
2
docs/assets/js/frappe-charts.min.js
vendored
2
docs/assets/js/frappe-charts.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -349,25 +349,21 @@ document.querySelector('[data-aggregation="average"]').addEventListener("click",
|
||||
|
||||
// Heatmap
|
||||
// ================================================================================
|
||||
let heatmap_data = {
|
||||
1479753000.0: 1,
|
||||
1498588200.0: 1,
|
||||
1499193000.0: 1,
|
||||
1499625000.0: 2,
|
||||
1500921000.0: 1,
|
||||
1501612200.0: 1,
|
||||
1502994600.0: 1,
|
||||
1503858600.0: 1,
|
||||
1504809000.0: 3,
|
||||
1505241000.0: 1,
|
||||
1506277800.0: 2
|
||||
};
|
||||
|
||||
let heatmap_data = {};
|
||||
let current_date = new Date();
|
||||
let timestamp = current_date.getTime()/1000;
|
||||
timestamp = Math.floor(timestamp - (timestamp % 86400)).toFixed(1); // convert to midnight
|
||||
for (var i = 0; i< 375; i++) {
|
||||
heatmap_data[parseInt(timestamp)] = Math.floor(Math.random() * 6);
|
||||
timestamp = Math.floor(timestamp - 86400).toFixed(1);
|
||||
}
|
||||
|
||||
new Chart({
|
||||
parent: "#chart-heatmap",
|
||||
data: heatmap_data,
|
||||
type: 'heatmap',
|
||||
height: 100,
|
||||
height: 115,
|
||||
discrete_domains: 1 // default 0
|
||||
});
|
||||
|
||||
|
||||
@ -215,7 +215,7 @@
|
||||
parent: "#heatmap",
|
||||
data: heatmap_data, // object with date/timestamp-value pairs
|
||||
type: 'heatmap',
|
||||
height: 100,
|
||||
height: 115,
|
||||
discrete_domains: 1 // default 0
|
||||
});</code></pre>
|
||||
</div>
|
||||
|
||||
@ -124,7 +124,8 @@ export default class Heatmap extends BaseChart {
|
||||
let data_value = 0;
|
||||
let color_index = 0;
|
||||
|
||||
let timestamp = Math.floor(current_date.getTime()/1000).toFixed(1);
|
||||
let current_timestamp = current_date.getTime()/1000;
|
||||
let timestamp = Math.floor(current_timestamp - (current_timestamp % 86400)).toFixed(1);
|
||||
|
||||
if(this.data[timestamp]) {
|
||||
data_value = this.data[timestamp];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user