[ZBX-13251] Problem with calculated min Y and max Y in graph zabbix 3.4 Created: 2017 Dec 23  Updated: 2018 Jan 02  Resolved: 2018 Jan 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 3.0.13
Fix Version/s: None

Type: Problem report Priority: Major
Reporter: ePawel Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: graphs
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Centos 7


Attachments: PNG File 13251.png     PNG File graph.png     PNG File thermometer_nice_scale_1_.png     PNG File thermometer_nice_scale_2.png     PNG File thermometer_nice_scale_3.png    

 Description   

Hi
I have problem with scaling on graph.

Create graph:
Y axis MIN value: Calculated
Y axis MAX value: Calculated

why the graph does not fit the line?



 Comments   
Comment by ePawel [ 2017 Dec 23 ]

vertices of the curve should determine the boundaries of the graph

Comment by Alexey Pustovalov [ 2017 Dec 23 ]

Hello!

Zabbix does not use max and min of data points as Y axis max/min. It calculates to fit the graph with optimal scale.

Kind regards,
Alexey.

Comment by ePawel [ 2017 Dec 23 ]

In the picture axis Y scale is min 18.5 to max 21.5 but line data point min/max is 19.96 to 20.22, why graph have not the same scale as data pointa?

Comment by Olegs Vasiljevs (Inactive) [ 2017 Dec 27 ]

Hello ePawel!

I'm sure that this is done intentionally in order to provide a better readability of a graph.
In your example, Zabbix still takes into consideration the empty dots to plot a graph. If you would select a smaller time period, Y axis would be lower than minimum and higher than maximum by only a small measure, for example:

P.S. Also, it is not clear whether the affected version is 3.4 or 3.0, since you have different information provided in the summary and affected version field. The above screenshot is from 3.0.

Regards,
Oleg

Comment by ePawel [ 2018 Jan 02 ]

I had the same problem in ver. 3.0.13 and 3.4
*************
I parse script /usr/share/zabbix/include/classes/graphdraw/cLineGraphDraw.php for a week and I changed some line like bellow:

><--><--><---->if (bcdiv((bcsub($absMaxY, $absMinY)), $absMaxY) <= 0.001) {
><--><--><--><--->if ($this>m_minY[$graphSide] > 0)

{ --><------><------><------><------><------>$this->m_minY[$graphSide] = bcmul($this->m_minY[$graphSide], 0.00); --><------><------><------><------>}

><--><--><--><---->else

{ --><------><------><------><------><------>$this->m_minY[$graphSide] = bcmul($this->m_minY[$graphSide], 0.001); --><------><------><------><------>}

><--><--><--><--->if ($this>m_maxY[$graphSide] > 0)

{ --><------><------><------><------><------>$this->m_maxY[$graphSide] = bcmul($this->m_maxY[$graphSide], 0.001); --><------><------><------><------>}

><--><--><--><---->else

{ --><------><------><------><------><------>$this->m_maxY[$graphSide] = bcmul($this->m_maxY[$graphSide], 0.00); --><------><------><------><------>}

><--><--><---->}
><--><---->}
><---->}

and I have received graph with nice better scale in Y (You can see on the diagram from today)
Can I damage zabbix after modify this file or not?

Comment by Olegs Vasiljevs (Inactive) [ 2018 Jan 02 ]

Hello epawel!

This only affects web frontend's visualization features, therefore should not have an impact on the real data stored.
Note that a package update procedure will overwrite your changes in the web frontend source files, therefore you would need to re-apply them after every update is done.

Closing the ticket as won't fix.

Regards,
Oleg

Comment by ePawel [ 2018 Jan 02 ]

Hi!
Thank you for help.
best regards, epawel

Generated at Sun Apr 13 23:02:50 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.