Skip to content
Open
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
6 changes: 3 additions & 3 deletions price_analysis_ocv.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,15 @@ def price_analysis(data_json): ## take json instead of png
angle = 360 / num_categories

# Maximum value for scaling
max_value = max(values)
max_value = sum(values)

# Radius of the radar chart
radius = min(center_x, center_y) - 150

data_points = []

for i in range(num_categories):
normalized_value = values[i] / max_value + 0.05
normalized_value = max(values[i] / max_value, 0.05)
x = int(center_x + radius * normalized_value * math.cos(math.radians(i * angle)))
y = int(center_y + radius * normalized_value * math.sin(math.radians(i * angle)))

Expand Down Expand Up @@ -385,4 +385,4 @@ def price_analysis(data_json): ## take json instead of png


# json_data = price_analysis(data)
# print(json_data)
# print(json_data)