I made a bar chart in Jupyter Notebook using Python and it works fine. However, when I look at the chart online, the formatting is different (hover text is there, font is different, etc).
Here’s my code: (not sure how to make code look right on here, but obviously the indentation is wrong)
data = [go.Bar(x = scores,
y = phrases,
orientation = ‘h’,
text = bar_text,
textposition = ‘inside’,
insidetextfont = dict(
size = 30,
color = ‘white’
),
opacity =.7,
marker = dict(
color =’#E41B17’,
line = dict(
color =’#000000’,
width = 1),
),
)]
layout = dict(
width = 600,
font = dict(family = ‘PT Sans Narrow’),
yaxis = dict(
showgrid = False,
showticklabels = False
),
xaxis=dict(title=’% Likelihood Phrase in Right Headlines’)
)
fig = go.Figure(data=data, layout=layout)
py.iplot(fig, filename='right_headlines')
And here it is online:
https://plot.ly/~VanessaVanG/15/
What’s also strange is the font is correct in the preview box on my files page.