from morinus.chart import Chart

def generate_chart_image(year, month, day, hour, minute, latitude, longitude):
    # Create a Morinus chart
    c = Chart(
        year=year,
        month=month,
        day=day,
        hour=hour,
        minute=minute,
        latitude=latitude,
        longitude=longitude,
        dst=False
    )
    
    # Generate chart as SVG (wheel chart)
    import os
    charts_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "charts", "birthchart")
    os.makedirs(charts_dir, exist_ok=True)
    svg_path = os.path.join(charts_dir, f"chart_{year}_{month}_{day}.svg")
    c.plot(filename=svg_path)  # Save chart as SVG
    return f"/charts/birthchart/chart_{year}_{month}_{day}.svg"