Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix by host summary chart creation #42

Merged
merged 4 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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