我有从数据集生成图表的代码。数据集中的某些点是空的,但是图表将这些空数据点绘制为0.我希望图表将它们绘制为图表中的间隙。下面是我的ASP代码。
<asp:Chart ID="FailStatusChart" runat="server">
<Series>
<asp:Series Name="Series1" Color="#CC3300">
<EmptyPointStyle BackImageTransparentColor="Transparent"
BackSecondaryColor="Transparent"
BorderColor="Transparent"
BorderDashStyle="NotSet"
Color="Transparent"
IsVisibleInLegend="False"
LabelBackColor="Transparent"
LabelBorderColor="Transparent"
LabelBorderDashStyle="NotSet"
LabelForeColor="Transparent"
BackGradientStyle="None" />
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
vb.net
For Each DataRow In ByteFailTable.Rows()
If DataRow(1) = "" Then
FailStatusChart.Series("Series1").Points.Item(DataRow(1)).IsEmpty = True
FailStatusChart.Series("Series1").Points(DataRow(1)).Color = Drawing.Color.Transparent
FailStatusChart.Series("Series1").Points.Remove(DataRow(1))
End If
Next