QuickPlot icon indicating copy to clipboard operation
QuickPlot copied to clipboard

options of the chart

Open delanoe opened this issue 8 years ago • 3 comments

Is it possible to custom the chart such as adding title, (x|y)axis title or legend options ?

Taking this example: boxLine x y = do let box = [plotly|{ x : #{ x }, y : #{ y }, type : "lines" }|] return box

How do you add a title, a legend (label of the curve) ?

Is it possible right now or the library needs more development/help ?

Thanks in advance for your answer and your great work

delanoe avatar Mar 18 '16 10:03 delanoe

Yes it is possible. If you look into Plotly.hs you can see there is an instance that lets you pass PlotlyLayout. So plot (data, layout) would do the trick.

I would recommend visiting plot.ly first if you don't know how to do X. Here are examples for legends.

schiegl avatar Mar 19 '16 10:03 schiegl

Ok, still looking for the way to build a PlotlyLayout (even if the example in javascript are clear for me). Do you have a minimal example please in order to understand the syntax? Thanks in advance.

delanoe avatar Mar 21 '16 14:03 delanoe

You pass the layout options just like you pass the data. Almost copy and paste from the website. But in this case this seems to be broken. Somehow plot.ly refuses to show them inside the rectangle. And unfortunately enough, JavaScript doesn't say a thing about it...

So yeah this is a bug.

schiegl avatar Mar 21 '16 16:03 schiegl