首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误栏未显示mschart中的所有值

问错误栏未显示mschart中的所有值
EN

Stack Overflow用户
提问于 2017-05-05 03:43:43
回答 1查看 113关注 0票数 0

我正在使用带有mschart的VB.NET。我使用的是ErroBar字符类型,但我不能标记所有的值(中、上、下)。当我设置chart.Series("ErrorBar").IsValueShownAsLabel = True时,只显示较高的值。

​

我想要显示中心值,上下值。

提前感谢

EN

回答 1

Stack Overflow用户

发布于 2017-05-05 06:06:08

我采用的解决方案是一个使用注释的更简单的解决方案,如下面的代码所示

代码语言:javascript
复制
    Dim Media1 As New RectangleAnnotation()
    Media1.BackColor = Color.Yellow
    Media1.Text = FormatNumber(D20, 4)
    Dim point As PointF = New PointF(chart.ChartAreas(0).AxisX.ValueToPosition(1), chart.ChartAreas(0).AxisY.ValueToPosition(D20))
    Media1.AnchorX = point.X + 10
    Media1.AnchorY = point.Y + 2
    Media1.AllowMoving = True

    Dim L1 As New RectangleAnnotation()
    L1.BackColor = Color.Yellow
    L1.Text = FormatNumber(D20 - result * My.Settings("IncertezaDensidade20") / 2, 4)
    point = New PointF(chart.ChartAreas(0).AxisX.ValueToPosition(1), chart.ChartAreas(0).AxisY.ValueToPosition(D20 - result * My.Settings("IncertezaDensidade20") / 2))
    L1.AnchorX = point.X
    L1.AnchorY = point.Y + 10
    L1.AllowMoving = True

    Dim L2 As New RectangleAnnotation()
    L2.BackColor = Color.Yellow
    L2.Text = FormatNumber(D20 + result * My.Settings("IncertezaDensidade20") / 2, 4)
    point = New PointF(chart.ChartAreas(0).AxisX.ValueToPosition(1), chart.ChartAreas(0).AxisY.ValueToPosition(D20 + result * My.Settings("IncertezaDensidade20") / 2))
    L2.AnchorX = point.X
    L2.AnchorY = point.Y - 5
    L2.AllowMoving = True

现在的图表可以在下面看到

​

​

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

https://stackoverflow.com/questions/43791569

复制
相关文章

相似问题

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