Setting plot layout attributes

Add labels to a simple line graph, turn off grid lines, and place limits on the y-axis.

module App
using GenieFramework
@genietools

data = PlotData(x=[1, 2, 3], y=[3, 1, 2], mode = "line")

layout = PlotLayout(
    xaxis=[PlotLayoutAxis(xy="x", title="x label", showgrid=false)],
    yaxis=[PlotLayoutAxis(xy="y", title="y label", showgrid=false, range=[0, 10])])

@app begin
    @out data
    @out layout
end

function ui()
[
    h1("GenieFramework ๐Ÿงž Data Visualization ๐Ÿ“Š")
    plot(:data, layout=:layout)
]
end

@page("/", ui)
Server.isrunning() || Server.up()
end

HTML UI

<h1>GenieFramework ๐Ÿงž Data Visualization ๐Ÿ“Š</h1>
<plotly :data="data" :layout="layout" :displaylogo="false"></plotly>

source