首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Axis LabelStyle在FSharpChart中不工作?

Axis LabelStyle在FSharpChart中不工作?
EN

Stack Overflow用户
提问于 2011-07-26 23:01:00
回答 1查看 267关注 0票数 1

我不知道如何在FSharpChart.WithArea中更改坐标轴上的字体。

这是我能想到的显示问题的最短示例(至少在我的机器上)。

代码语言:javascript
复制
#r "System.Windows.Forms.DataVisualization.dll"
#r "MSDN.FSharp.Charting.dll"
open System.Windows.Forms.DataVisualization.Charting
open MSDN.FSharp.Charting
open System.Drawing

let font = new Font("Wingdings", 10.0F)

FSharpChart.FastLine([(0.,1.);(10., 10.)])
|> FSharpChart.WithArea.AxisX(LabelStyle = new LabelStyle(Font = font))
|> FSharpChart.WithCreate
EN

回答 1

Stack Overflow用户

发布于 2011-07-27 00:43:39

这是库中的一个错误。如果您想自己修复它,请下载源代码并找到一行定义typesToClone的代码。它应该看起来像这样:

代码语言:javascript
复制
let typesToClone = 
    [ typeof<LabelStyle>; typeof<Axis>; typeof<Grid>; typeof<TickMark>
      typeof<ElementPosition>; typeof<AxisScaleView>; typeof<AxisScrollBar>; ]

这定义了在创建图表时复制其属性的类型的列表。问题是名称LabelStyle引用的是F#图表库源代码中的类型,而不是.NET图表控件类型System.Windows.Forms.DataVisualization.Charting.LabelStyle。它可以通过使用完整的类型名称来修复:

代码语言:javascript
复制
let typesToClone = 
    [ typeof<System.Windows.Forms.DataVisualization.Charting.LabelStyle>; 
      typeof<Axis>; typeof<Grid>; typeof<TickMark>
      typeof<ElementPosition>; typeof<AxisScaleView>; typeof<AxisScrollBar>; ]

我会将此信息发送给该库的当前维护者,以确保下一个版本包含对此的修复。感谢您报告此问题!

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6832127

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档