Bar Chart

Bullet Chart Dark

Bullet chart showing actual vs target

Output
Bullet Chart Dark
Python
import matplotlib.pyplot as plt
import numpy as np

metrics = ['Revenue', 'Profit', 'Customers', 'Satisfaction', 'NPS']
actuals = [85, 72, 91, 78, 65]
targets = [80, 80, 85, 80, 70]

fig, axes = plt.subplots(5, 1, figsize=(10, 8), facecolor='#0a0a0f')

for i, (ax, metric, actual, target) in enumerate(zip(axes, metrics, actuals, targets)):
    ax.set_facecolor('#0a0a0f')
    
    ax.barh(0, 100, height=0.8, color='#1a1a2e')
    ax.barh(0, 75, height=0.8, color='#252535')
    ax.barh(0, 50, height=0.8, color='#333344')
    
    color = '#6CF527' if actual >= target else '#F5276C'
    ax.barh(0, actual, height=0.4, color=color)
    
    ax.plot([target, target], [-0.35, 0.35], color='white', linewidth=3)
    
    ax.set_xlim(0, 100)
    ax.set_ylim(-0.5, 0.5)
    ax.set_yticks([0])
    ax.set_yticklabels([metric], color='white', fontsize=10)
    ax.tick_params(axis='x', colors='#888888', labelsize=8)
    
    for spine in ax.spines.values():
        spine.set_visible(False)
    
    if i < 4:
        ax.set_xticks([])

axes[0].set_title('KPI Performance Dashboard', color='white', fontsize=14, fontweight='bold', pad=15)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support