Skip to content

Commit a48262a

Browse files
committed
Fixes
1 parent e7abf53 commit a48262a

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

assets/js/scripts.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,20 @@ document.addEventListener('DOMContentLoaded', () => {
501501
/**
502502
* Charts
503503
*/
504+
const chart = (instance, options, timestamps) => {
505+
const {title, tooltip = {}, legend, yAxis, series} = options;
506+
507+
instance.setOption({
508+
backgroundColor: 'transparent',
509+
title: {text: title, left: 'left', padding: [0, 5, 5, 5]},
510+
tooltip: {trigger: 'axis', ...tooltip},
511+
legend: {data: legend, type: 'scroll', bottom: 0},
512+
xAxis: {type: 'category', boundaryGap: false, data: timestamps},
513+
yAxis: yAxis,
514+
series: series,
515+
grid: {left: 10, right: 10, top: 80, bottom: 60}
516+
});
517+
};
504518
const time_switcher = (callback) => {
505519
const default_btn_classes = ['hover:text-gray-600', 'dark:hover:text-gray-300'];
506520
const active_btn_classes = ['shadow-sm', 'bg-white', 'dark:bg-gray-700'];

templates/dashboards/memcached/metrics.twig

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,6 @@
5151
const HIT_RATE_COMMANDS = ['get', 'delete', 'incr', 'decr', 'cas', 'touch'];
5252
const REQUEST_RATE_COMMANDS = ['get', 'set', 'delete', 'incr', 'decr', 'cas', 'touch', 'flush'];
5353
54-
const chart = (instance, options, timestamps) => {
55-
const {title, tooltip = {}, legend, yAxis, series} = options;
56-
57-
instance.setOption({
58-
backgroundColor: 'transparent',
59-
title: {text: title, left: 'left', padding: [0, 5, 5, 5]},
60-
tooltip: {trigger: 'axis', ...tooltip},
61-
legend: {data: legend, type: 'scroll', bottom: 0},
62-
xAxis: {type: 'category', boundaryGap: false, data: timestamps},
63-
yAxis: yAxis,
64-
series: series,
65-
grid: {left: 10, right: 10, top: 80, bottom: 60}
66-
});
67-
};
68-
6954
const render_charts = (data) => {
7055
if (!data || data.length === 0) return;
7156
const timestamps = data.map(p => p.timestamp.split(' ')[1]);

0 commit comments

Comments
 (0)