im still new at bokeh
so, im using stock market dataset, which contain columns like : Company names, date, and volume.
Im trying to plot all of that into one graph with vbar, with Date on X axis, Volume in Y axis.
each companies has its own datasets, so i make 3 source.
Now im finished on plotting all of these, but the problem is:
The value of 'Volume' in one from three companies is very low comparing to others.
These makes my plot for this low-value company is looking 'Flat'.
maybe it is easier if i show you my plot and my code:
Code:
output_notebook()
from math import pi
t_v = [("Date", "@Date{%d-%m-%Y}"),
("Name", "@{Name}"),
("Volume", "@{Volume}")]
f_v = {"@Date": "datetime",
"@{Adj Close}": "printf"
}
w = datetime.timedelta(days=1) # day in ms
plot2 = figure(x_axis_type="datetime", height=900,title="Visualisasi Data Interaktif Fluktuasi Harga Saham",sizing_mode="stretch_width")
plot2.xaxis.axis_label = 'Date'
plot2.yaxis.axis_label = 'Volume'
plot2.xaxis.major_label_orientation = pi/4 #Kemiringan label x
plot2.grid.grid_line_alpha=0.3 #transparansi grid
#plot2.legend.click_policy="hide"
p1v=plot2.vbar(x=dodge('Date',-0.25), width=w, top='Volume', bottom=0,color="blue", legend_label='NASDAQ',alpha=0.1,source=nasdaq_source)
plot2.add_tools(HoverTool(renderers=[p1v],
tooltips=t_v,
formatters = f_v,
point_policy="follow_mouse"))
p2v=plot2.vbar(x=dodge('Date',0.0), width=w, top='Volume', bottom=0,color="green", legend_label='NIKKEI',alpha=1,source=nikkei_source)
plot2.add_tools(HoverTool(renderers=[p2v],
tooltips=t_v,
formatters = f_v,
point_policy="follow_mouse"))
p3v=plot2.vbar(x=dodge('Date',0.25), width=w, top='Volume', bottom=0,color="red", legend_label='HANG SENG',alpha=0.1,source=hs_source)
plot2.add_tools(HoverTool(renderers=[p3v],
tooltips=t_v,
formatters = f_v,
point_policy="follow_mouse"))
plot2.legend.click_policy="hide"
tab2 = Panel(child=plot2, title ="Volume")
show(Tabs(tabs=[tab1,tab2]))
Output:
All Companies
Nikkei, The Company with lowest value of 'Volume'
Comparison value of 'Volume' between two company
question from:
https://stackoverflow.com/questions/65649994/trying-plotting-vbar-3-source-with-high-range-value-in-bokeh