Ad Widget

Collapse

PATCH: Version Pre 1.5 Build 4672 - Pie Charts and Integer Values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Palmertree
    Senior Member
    • Sep 2005
    • 746

    #1

    PATCH: Version Pre 1.5 Build 4672 - Pie Charts and Integer Values

    When viewing a "Pie Chart" and a "3d Pie Chart", Integer values are displaying as floating numbers and not Integers.

    To correct this modify the file
    zabbix/include/classes/pie.inc.php

    Before:
    $proc = ($datavalue * 100)/ $this->sum;

    if(isset($data) && isset($datavalue)){
    $strvalue = sprintf("Value: %0.4f (%0.2f%s)",$datavalue,$proc,'%');
    $str = sprintf("%s: %s [%s] ",
    str_pad($this->items[$i]['host'],$max_host_len,' '),
    str_pad($this->items[$i]['description'],$max_desc_len,' '),
    $fnc_name);
    }
    else{
    $strvalue = sprintf("Value: no data");
    $str=sprintf("%s: %s [ no data ]",
    str_pad($this->items[$i]['host'],$max_host_len,' '),
    str_pad($this->items[$i]['description'],$max_desc_len,' '));
    }

    After:
    $proc = ($datavalue * 100)/ $this->sum;

    if(isset($data) && isset($datavalue)){
    $strvalue = sprintf("Value: %s (%0.2f%s)",$datavalue,$proc,'%');
    $str = sprintf("%s: %s [%s] ",
    str_pad($this->items[$i]['host'],$max_host_len,' '),
    str_pad($this->items[$i]['description'],$max_desc_len,' '),
    $fnc_name);
    }
    else{
    $strvalue = sprintf("Value: no data");
    $str=sprintf("%s: %s [ no data ]",
    str_pad($this->items[$i]['host'],$max_host_len,' '),
    str_pad($this->items[$i]['description'],$max_desc_len,' '));
    }
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Thanks for reporting this!
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    Working...