mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-08 05:45:21 +02:00
fix(insights): sankey diagram inconsistent sizing
This commit is contained in:
@@ -47,7 +47,7 @@ def generate_sankey_data(transactions_queryset):
|
|||||||
# Function to add flow
|
# Function to add flow
|
||||||
def add_flow(from_node, to_node, amount, currency):
|
def add_flow(from_node, to_node, amount, currency):
|
||||||
percentage = (amount / total_amount) * 100 if total_amount else 0
|
percentage = (amount / total_amount) * 100 if total_amount else 0
|
||||||
scaled_flow = 1 + min(percentage / 5, 2) # Scale 1-5, capping at 100%
|
scaled_flow = 1 + min(percentage / 20, 4) # Scale 1-5, capping at 100%
|
||||||
flows.append(
|
flows.append(
|
||||||
{
|
{
|
||||||
"from_node": from_node,
|
"from_node": from_node,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{% extends "layouts/base.html" %}
|
{% extends "layouts/base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<canvas id="sankeyChart" class="h-100"></canvas>
|
<canvas id="sankeyChart" height="379"></canvas>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function setupSankeyChart(data, chartId = 'sankeyChart') {
|
function setupSankeyChart(data, chartId = 'sankeyChart') {
|
||||||
|
|||||||
Reference in New Issue
Block a user