I'm trying out Dash from a Julia perspective to create a dashboard. I have a working graph with the following code.
using DataFrames, XLSX, Dates, Dash, DashHtmlComponents, DashCoreComponents, StatsPlots, Indicators
df = DataFrame(XLSX.readtable("file.xlsx", "Price", infer_eltypes=true)...)
filter!(row -> row.Date >= Date(2018,12,1), df)
sort!(df)
app = dash()
app.layout = html_div() do
html_h1("Price graph"),
dcc_graph(
id = "example-graph-1",
figure = (
data = [
(x = df.Date, y = df.Closeprice, type = "line", name = "Closeprice"),
(x = df.Date, y = sma(df.Closeprice, n=50), type = "line", name = "SMA50"),
(x = df.Date, y = sma(df.Closeprice, n=200), type = "line", name = "SMA200")
],
layout = (title = "Simple Moving Average", barmode="group")
)
)
end
run_server(app, "0.0.0.0", debug=true)
Now I want to create some horizontal lines over this graph at certain points on the y-axies. I have tried looking through documentation but haven't found any good examples on how to create horizontal lines.
When I used Statsplotlibrary I could use hline and vline to create different lines, but that doesn't seem to work in Dash. Any guidance would be appreciated.
