vb.net - 带有多色文本的图表标注注释
问题描述
我的图表上有一个标注注释,它使用 ForeColor 属性以红色显示文本变量名称“StringContent”。但我想要一个自定义的文本颜色,即一些文本是蓝色的,一些是红色的。我已经通过 MSDN 进行了搜索,并且没有任何 OnPaint 方法可以覆盖以进行自定义标注。请指导我。谢谢你。代码片段如下所示:
Chart1.Annotations.Clear()
ta = New CalloutAnnotation
With ta
.AnchorDataPoint = Chart1.Series(0).Points(result.PointIndex)
.Text = "::: { - - DETAILS - - } ::: " & StrDup(2, vbLf) & StringContent
.ForeColor = Color.Red
.Text += "Blue Colored Text Will Go here"
.ForeColor = Color.Blue '// With this line all text obviously will go blue
.ShadowColor = Color.Black
.ShadowOffset = 2
.Font = New Font("Franklin Gothic Book", 9.5, FontStyle.Regular)
.SmartLabelStyle.MovingDirection = LabelAlignmentStyles.Center
.SmartLabelStyle.AllowOutsidePlotArea = LabelOutsidePlotAreaStyle.No
.AllowMoving = True
End With
解决方案
推荐阅读
- visual-studio - 在不关闭 IntelliSense 的情况下关闭 Visual Studio 2019 中的自动建议
- azure - Azure VPN 客户端 | 如何在每次连接完成时启用 MFA 登录
- c# - XAML/UWP 为画布上的形状添加阴影
- php - Symfony 5 抛出拒绝访问异常
- z3 - seq.nth 在存在表达式中的奇怪行为
- dataframe - pySpark dict(键,值,值)
- linux - 如何更改 asm x64 中的 errno 值
- typescript - 如何以有效的方式替换对象值?
- php - 如何连接 AS400 和 Laravel
- c# - C# checkboxlist:如何避免通过单击标签来更改复选框状态?