f#-charting

How to display an FSharp.Charting graph in an existing form?

白昼怎懂夜的黑 提交于 2020-01-21 03:40:27
问题 I don't understand how to create a chart control and place the chart in an existing form. All the examples I found on the web show the chart in a new form but I would like to add the chart to one of my existing forms. I'm thinking of something like this: let form = new Form(Text="My form") let lbl = new Label(Text="my label") let chart = Chart.Area ["a", 10; "b", 20] form.Controls.Add lbl form.Controls.Add chart // ---> The type 'ChartTypes.GenericChart' is not compatible with the type

FSharpChart.SaveAs () saves blank image if called before chart rendering is complete

强颜欢笑 提交于 2020-01-14 08:44:11
问题 When run in F# Interactive, I expect the following code to create a simple pie chart and save it to disk: let pie = FSharpChart.Pie([("Apples",1);("Oranges",2);("Bananas",3)]) FSharpChart.SaveAs "test.png" ChartImageFormat.Png pie However, what actually gets saved in "test.png" is a blank image. The same happens if I pipe the chart into the FShartChart.SaveAs function. But if I first execute only the chart creation code and give the chart time to render before manually executing SaveAs, the

How to show labels on x axis for each element?

戏子无情 提交于 2019-12-10 21:57:51
问题 I have sequence of tuples containing filename and number. I want to draw column graph where on X axis I have filenames. My problem is that now only 3 labels (filenames) are shown under X axis. That's probably because more can't fit on screen. Or maybe X axis interval is wrong? How to make chart display all filenames? Maybe there is a way to rotate those labels 90 degrees counterclockwise to make room for more labels? 回答1: You should be able to use: |> Chart.WithXAxis (LabelStyle = ChartTypes

How to display an FSharp.Charting graph in an existing form?

不问归期 提交于 2019-11-30 15:22:22
I don't understand how to create a chart control and place the chart in an existing form. All the examples I found on the web show the chart in a new form but I would like to add the chart to one of my existing forms. I'm thinking of something like this: let form = new Form(Text="My form") let lbl = new Label(Text="my label") let chart = Chart.Area ["a", 10; "b", 20] form.Controls.Add lbl form.Controls.Add chart // ---> The type 'ChartTypes.GenericChart' is not compatible with the type 'Control' Application.Run(form) Thanks! In order to achieve this you should wrap your chart into FSharp