When i am using candlestick inside of candlestick is lighter than borders. How can i make both of them one color?
Hi @gridiron9999,
You can set the candlestick fill colors using the increasing.fillcolor
and decreasing.fillcolor
properties. And the line colors are set using the increasing.line.color
and decreasing.line.color
properties. Hereβs an example
import plotly.graph_objs as go
from datetime import datetime
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode()
open_data = [33.0, 33.3, 33.5, 33.0, 34.1]
high_data = [33.1, 33.3, 33.6, 33.2, 34.8]
low_data = [32.7, 32.7, 32.8, 32.6, 32.8]
close_data = [33.0, 32.9, 33.3, 33.1, 33.1]
dates = [datetime(year=2013, month=10, day=10),
datetime(year=2013, month=11, day=10),
datetime(year=2013, month=12, day=10),
datetime(year=2014, month=1, day=10),
datetime(year=2014, month=2, day=10)]
trace = go.Candlestick(x=dates,
open=open_data,
high=high_data,
low=low_data,
close=close_data)
fig = go.Figure([trace])
cs = fig.data[0]
# Set line and fill colors
cs.increasing.fillcolor = '#3D9970'
cs.increasing.line.color = '#3D9970'
cs.decreasing.fillcolor = '#FF4136'
cs.decreasing.line.color = '#FF4136'
iplot(fig)
Hope that helps!
-Jon
3 Likes