Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-13165

Graph min max calculation with huge values

    Details

    • Team:
      Team B
    • Sprint:
      Sprint 25, Sprint 26, Sprint 27, Sprint 28, Sprint 29, Sprint 30, Sprint 31, Sprint 32, Sprint 33, Sprint 34, Sprint 35, Sprint 36, Sprint 37, Sprint 38
    • Story Points:
      1

      Description

      Calculated Y max and min makes the graph useless.

      Steps to reproduce:
      Monitor an item which has huge value (tens of millions) and raises slowly (in hundreds) and use graph with automatically calculated Ymin and Ymax

      Result:
      See screenshot chart2-wrong.png

      Expected:
      See screenshot chart2-ok.png

      My fix:

      diff --git a/include/classes/graphdraw/CLineGraphDraw.php.orig b/include/classes/graphdraw/CLineGraphDraw.php
      index 2abf7c9..cb0ac20 100644
      --- a/include/classes/graphdraw/CLineGraphDraw.php.orig
      +++ b/include/classes/graphdraw/CLineGraphDraw.php
      @@ -2532,7 +2532,7 @@ class CLineGraphDraw extends CGraphDraw {
                                              $absMinY = $oldAbMaxY;
                                      }
       
      -                               if (bcdiv((bcsub($absMaxY, $absMinY)), $absMaxY) <= 0.1) {
      +                               if (bcdiv((bcsub($absMaxY, $absMinY)), $absMaxY) <= 0) {
                                              if ($this->m_minY[$graphSide] > 0) {
                                                      $this->m_minY[$graphSide] = bcmul($this->m_minY[$graphSide], 0.95);
                                              }
      

      Can you rethink this logic somehow?

        Attachments

        1. chart2-ok.png
          chart2-ok.png
          23 kB
        2. chart2-wrong.png
          chart2-wrong.png
          21 kB
        3. graph.png
          graph.png
          28 kB

          Activity

            People

            • Assignee:
              iivs Ivo Kurzemnieks
              Reporter:
              danman Daniel Kucera
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: