fix histogram not showing in legend

This commit is contained in:
louisnw
2024-06-08 11:09:00 +01:00
parent 5915160274
commit 3e2210ca02

View File

@ -489,19 +489,17 @@ class Histogram(SeriesCommon):
super().__init__(chart, name) super().__init__(chart, name)
self.color = color self.color = color
self.run_script(f''' self.run_script(f'''
{self.id} = {{ {self.id} = {chart.id}.createHistogramSeries(
type: "histogram", "{name}",
series: {chart.id}.chart.addHistogramSeries({{ {{
color: '{color}', color: '{color}',
lastValueVisible: {jbool(price_label)}, lastValueVisible: {jbool(price_label)},
priceLineVisible: {jbool(price_line)}, priceLineVisible: {jbool(price_line)},
priceScaleId: '{self.id}', priceScaleId: '{self.id}',
priceFormat: {{type: "volume"}}, priceFormat: {{type: "volume"}},
}}), }},
name: '{name}', // precision: 2,
color: '{color}', )
precision: 2,
}}
{self.id}.series.priceScale().applyOptions({{ {self.id}.series.priceScale().applyOptions({{
scaleMargins: {{top:{scale_margin_top}, bottom: {scale_margin_bottom}}} scaleMargins: {{top:{scale_margin_top}, bottom: {scale_margin_bottom}}}
}})''') }})''')