fix histogram not showing in legend
This commit is contained in:
@ -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}}}
|
||||||
}})''')
|
}})''')
|
||||||
|
|||||||
Reference in New Issue
Block a user