Skip to content

hvPlot Bolded Grey Multi-index #1709

@adam-morse

Description

@adam-morse
Software Version Info
hvplot: 0.11.3

Description of expected behavior and the observed behavior

This is an issue with hvplot's bar rendering that I mentioned to the core developers in the 12/17/25 Holoviz Office Hours meeting.

The issue was the multi-index, primary index showing up in the dashboard with a bolded grey font. It was showing up fuzzy in our app and I was asked to fix it. But I couldn't figure it out. When I moved to Bokeh it was easily remedied.

My feelings aren't hurt if folks don't think its worth the time to fix or improve. Maybe moving to Bokeh to customize styling is the right path. In hindsight removing the label altogether through display(chart.opts(multi_level=False)) would have served my specific needs, but I didn't know it at the time.

Complete, minimal, self-contained example code that reproduces the issue

import pandas as pd
import numpy as np
import holoviews as hv
import hvplot.pandas 


# DataFrame: Scenario, Asset, Value, Value_formatted
data = [
    {"Scenario": "Default - High PV", "Asset": "PV", "Value": 120.0},
    {"Scenario": "Default - High PV", "Asset": "Battery", "Value": 300.0},
    {"Scenario": "Default - High PV", "Asset": "Gen-set", "Value": 50.0},
    {"Scenario": "Alt - No PV", "Asset": "PV", "Value": 0.0},
    {"Scenario": "Alt - No PV", "Asset": "Battery", "Value": 200.0},
    {"Scenario": "Alt - No PV", "Asset": "Gen-set", "Value": 120.0},
    {"Scenario": "Battery-Heavy", "Asset": "PV", "Value": 80.0},
    {"Scenario": "Battery-Heavy", "Asset": "Battery", "Value": 600.0},
    {"Scenario": "Battery-Heavy", "Asset": "Gen-set", "Value": 20.0},
]
df = pd.DataFrame(data)
unit_map = {"PV": "kWdc", "Battery": "kWh", "Gen-set": "kW"}
df['Value_formatted'] = df.apply(lambda r: f"{r['Value']:.1f} {unit_map[r['Asset']]}", axis=1)
# Preserve scenario display order
df['Scenario'] = pd.Categorical(df['Scenario'], categories=list(df['Scenario'].unique()), ordered=True)

chart = df.hvplot.bar(
    x="Scenario", y="Value", by="Asset",
    rot=45, hover=True, hover_cols=["Value_formatted"],
    title="Grouped bar: Scenario x Asset",
    responsive=True,
    height=300,
    xlabel="",
)

display(chart)

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

  • I may be interested in making a pull request to address this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions