lightweight-charts-python icon indicating copy to clipboard operation
lightweight-charts-python copied to clipboard

Legend only allows float, 2

Open esteban2006 opened this issue 1 year ago • 0 comments

Expected Behavior

Legend should allow (float, x) where x is the market's digits

image data.csv

Current Behaviour

In the image above, We can see that price precision is 5, but legend remains 2, I am also adding data.csv so you try it yourself.

Reproducible Example

import pandas as pd
from lightweight_charts import Chart

if __name__ == "__main__":
    chart = Chart()

    df = pd.read_csv("data.csv")
    chart.set(df)
    chart.legend(
        color="#FFFFFF",
        visible=True,
        ohlc=True,
        percent=True,
        lines=True,
    )
    chart.precision(5)
    line_name = "EMA_18"
    line = chart.create_line(name=line_name, color="white")
    line.set(df[["time", line_name]])

    chart.show(block=True)

Environment

- OS: Windown 
- Library: v2.0.1

esteban2006 avatar Aug 05 '24 14:08 esteban2006