我正在使用卡洛斯·阿奎莱拉的 WebChart控制并希望更改图例标记以匹配我在线上使用的线标记。我有以下图表:
这是我的图例代码:
objLegend = New WebChart.ChartLegend
objLegend.Font = New Font("Verdana", 8)
objLegend.Width = 150
objLegend.Position = LegendPosition.Right
objLegend.Background.Color = Color.LightYellow
objLegend.Background.Type = InteriorType.Solid
objLegend.Background.WrapMode = Drawing2D.WrapMode.Tile
objEngine.Legend = objLegend
以及设置线标记的代码
Select Case intColorIndex Mod 5
Case 0
objLineChart.LineMarker = New CircleLineMarker(6, Color.Red, Color.Black)
Case 1
objLineChart.LineMarker = New DiamondLineMarker(6, Color.Red, Color.Black)
Case 2
objLineChart.LineMarker = New SquareLineMarker(6, Color.Red, Color.Black)
Case 3
objLineChart.LineMarker = New TriangleLineMarker(6, Color.Red, Color.Black)
Case 4
objLineChart.LineMarker = New XLineMarker(6, Color.Red, Color.Black)
End Select
这些地方似乎都没有设置图例标记类型的属性,而且
ChartEngine
中似乎也没有选项。对象。图例文本每行设置,但唯一可访问的属性来自
LineChart
是文本,似乎没有符号选项。是否可以使用此控件更改图例标记?如果是这样,我该怎么做?
最佳答案
在 http://www.carlosag.net/tools/webchart/sample-pie-chart图例符号看起来像是在标记中设置的:
<web:chartcontrol>
...
<legend width="110" font="Tahoma, 6.75pt">
<border endcap="Flat" dashstyle="Solid"
startcap="Flat" color="Black" width="1"
linejoin="Miter"></border>
<background type="Solid" startpoint="0, 0"
forecolor="Black" endpoint="0, 100" color="White"
hatchstyle="Horizontal"></background>
</legend>
</web:chartcontrol>
您可以尝试通过操作
<legend>
来设置图例符号。里面的元素 <web:chartcontrol>
.
关于.net - 如何更改网络图表上的图例符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13387150/