Skip to content

Commit

Permalink
Merge pull request #42 from dudacgf/master
Browse files Browse the repository at this point in the history
Fix by host summary chart creation
  • Loading branch information
TheGroundZero authored Oct 26, 2023
2 parents 7319eb3 + f6624a4 commit 1bcf1cc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
16 changes: 4 additions & 12 deletions openvasreporting/libs/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,37 +914,29 @@ def __row_height(text, width):
# CHART
# --------------------
chart_sumcvss_summary = workbook.add_chart({'type': 'column'})

chart_sumcvss_summary.add_series({
'name': 'critical',
'categories': '={}!D4:D{}'.format(sheet_name, max_hosts + 3),
'values': '={}!E4:E{}'.format(sheet_name, max_hosts + 3),
'data_labels': {'value': True, 'position': 'outside_end', 'leader_lines': True, 'font': {'name': 'Tahoma', 'size': 8}},
'fill': { 'width': 8, 'color': Config.colors()['critical']},
'border': { 'color': Config.colors()['blue']},
})
chart_sumcvss_summary.add_series({
'name': 'high',
'categories': '={}!D4:D{}'.format(sheet_name, max_hosts + 3),
'values': '={}!F4:F{}'.format(sheet_name, max_hosts + 3),
'data_labels': {'value': True, 'position': 'outside_end', 'leader_lines': True, 'font': {'name': 'Tahoma', 'size': 8}},
'fill': { 'width': 8, 'color': Config.colors()['high']},
'border': { 'color': Config.colors()['blue']},
})
chart_sumcvss_summary.add_series({
'name': 'medium',
'categories': '={}!D4:D{}'.format(sheet_name, max_hosts + 3),
'values': '={}!G4:G{}'.format(sheet_name, max_hosts + 3),
'data_labels': {'value': True, 'position': 'outside_end', 'leader_lines': True, 'font': {'name': 'Tahoma', 'size': 8}},
'fill': { 'width': 8, 'color': Config.colors()['medium']},
'border': { 'color': Config.colors()['blue']},
})

#chart_sumcvss_summary.add_series({
#'name': 'Hosts Ranking',
#'categories': '={}!D4:D{}'.format(sheet_name, max_hosts + 3),
#'values': '={}!E4:G{}'.format(sheet_name, max_hosts + 3),
#'data_labels': {'value': True, 'position': 'outside_end', 'leader_lines': True, 'font': {'name': 'Tahoma', 'size': 8}},
#'line': { 'width': 8, 'color': Config.colors()['blue']},
#'border': { 'color': Config.colors()['blue']},
#})

chart_sumcvss_summary.set_title({'name': 'Hosts by CVSS', 'overlay': False, 'font': {'name': 'Tahoma'}})
chart_sumcvss_summary.set_size({'width': 750, 'height': 350})
chart_sumcvss_summary.set_legend({'position': 'left', 'font': {'name': 'Tahoma'}})
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ netaddr>=0.8.0
numpy>=1.21.4
packaging>=21.2
pep517>=0.12.0
Pillow>=8.4.0
Pillow>=10.1.0
pip>=21.3.1
pyparsing>=2.4.7
python-dateutil>=2.8.2
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = OpenVAS Reporting
version = 1.5.post3
version = 1.5.4
description = A tool to convert OpenVAS XML into reports.
long_description = file: README.md, LICENSE, CHANGELOG
long_description_content_type = text/markdown
Expand Down

0 comments on commit 1bcf1cc

Please sign in to comment.