Skip to content

[BUG] horizontal_line axis_label_visible=False does not hide Y-axis label #577

@mohanish3795

Description

@mohanish3795

Expected Behavior

The Y-axis labels for the horizontal line values (70 and 30) should not appear when axis_label_visible=False

Current Behaviour

When adding a horizontal line to a line series (e.g., in a subchart for RSI) using horizontal_line(value, ..., axis_label_visible=False), the label for that value still appears on the Y-axis. This happens even when trying additional parameters like text=''. The dashed line itself renders correctly, but the axis label persists.

Reproducible Example

import pandas as pd
from lightweight_charts import Chart

if __name__ == '__main__':
    # Sample data
    df = pd.DataFrame({
        'time': pd.date_range(start='2023-01-01', periods=100).strftime('%Y-%m-%d'),
        'value': pd.Series(range(100)) % 80 + 10  # Simulated RSI-like values between 10-90
    })

    # Create main chart (empty for this example)
    chart = Chart()
    chart.time_scale(visible=False)

    # Create subchart
    subchart = chart.create_subchart(height=0.5)

    # Add line series
    line = subchart.create_line('Test Line')
    line.set(df)

    # Add horizontal lines with labels hidden
    line.horizontal_line(70, color='red', width=1, style='dashed', axis_label_visible=False, text='')
    line.horizontal_line(30, color='green', width=1, style='dashed', axis_label_visible=False, text='')

    chart.show(block=True)

Environment

- OS:
- Library:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions