diff --git a/frontend/express/public/javascripts/countly/vue/components/vis.js b/frontend/express/public/javascripts/countly/vue/components/vis.js index 7444777424c..dbef2a352cc 100644 --- a/frontend/express/public/javascripts/countly/vue/components/vis.js +++ b/frontend/express/public/javascripts/countly/vue/components/vis.js @@ -1047,8 +1047,23 @@ return notes; }, graphNotesTooltipFormatter: function(arr, params) { - var template = ""; var filteredNotes = arr.filter(x=>x.dateStr === params.data.note.dateStr && x.times > 1); + var minimizeTooltip = false; + var template = ""; + var conditionalClassName = "graph-notes-tooltip"; + + if ((this.$refs && this.$refs.echarts) && (this.$refs.echarts.getHeight() < 200 || this.$refs.echarts.getWidth() < 500)) { + minimizeTooltip = true; + } + + + if (minimizeTooltip) { + conditionalClassName = 'graph-notes-tooltip minimize'; + } + else if (!minimizeTooltip && filteredNotes.length > 0) { + conditionalClassName = 'graph-notes-tooltip bu-mb-4 bu-mx-2'; + } + if (filteredNotes.length > 0) { for (var i = 0; i < filteredNotes.length; i++) { if (i === 0) { @@ -1059,18 +1074,18 @@ \