Cacti / plugin_gexport

Cacti Graph Export Plugin
GNU General Public License v2.0
12 stars 9 forks source link

traffic row data display wrong value when it export to HTML #43

Closed frontierliu closed 4 years ago

frontierliu commented 5 years ago

Version: 1.2.5 When I export the traffic graph data to HTML and CSV, I found the HTML data is different to CSV. example: HTML data: QQ图片20191030114957

CSV data: QQ图片20191030115007

The reason is when CACTI export to HTML, it use a default graph base_value=1024 to calculate number format, When CACTI export to CSV, it just export the exact value . Traffic data should use base_value=1000, 1024 is for disk space, memory, etc.

how to fix: orginal: graph_export.php line 214: print "" . trim(number_format_i18n(round($row['col' . $i],3))) . ''; modify to: print "" . trim(number_format_i18n(round($row['col' . $i],3),2,$graph_info['base_value'])) . '';

I have verified and it works ok.

TheWitness commented 4 years ago

This is not a gexport problem.