1

使用 F# Charting 我可以更改轴标签字体大小

    chart |> Chart.WithArea.AxisX(LabelStyle = myStyle)

但是还没有找到改变数据点标签字体大小的方法

    let myChart = Chart.Line prices |> Chart.WithDataPointLables(Label = "hello")

如上创建。

有谁知道该怎么做?

4

1 回答 1

3

这似乎没有直接得到支持,FSharp.Charting但该库确实通过其抽象提供了一个漏洞,因此您可以访问底层图表表示并做任何您想做的事情。假设您在 Windows 上使用System.Windows.Forms.DataVisualization库默认使用的 运行它,那么您可以执行以下操作:

open FSharp.Charting

Chart.Line [1; 2; 3]
|> Chart.WithDataPointLabels(Label = "hello")
|> fun c -> c.ApplyToChart(fun c ->
    c.Series.[0].Font <- System.Drawing.Font("Verdana", float32 28))
于 2017-06-15T10:31:28.380 回答