MS Chart Control取消爆炸饼图点

时间:2013-09-25 07:12:08

标签: asp.net charts

我试图在饼图中爆炸或破坏爆炸点 然而,当我爆炸一个点时它“知道”它会爆炸,但它在图表上看起来并不是这样。

Protected Sub Chart2_Click(sender As Object, e As ImageMapEventArgs) Handles Chart2.Click


    Dim pointIndex As Int32 = Int32.Parse(e.PostBackValue)

    If pointIndex >= 0 & pointIndex < Series1.Points.Count Then
        If Series1.Points(pointIndex)("Exploded") = "True" Then
            Series1.Points(pointIndex)("Exploded") = "False"
            Series1.Points(pointIndex).MapAreaAttributes += "onclick=""alert('Test explode alert');"""
        Else
            Series1.Points(pointIndex)("Exploded") = "True"
        End If
    End If

End Sub

我确实得到了'测试爆炸警报',但那时候饼点并没有在视觉上爆炸 删除Series1.Points(pointIndex)("Exploded") = "False"会使点在视觉上爆炸,但不会内爆/不爆炸。

如何破坏或取消爆炸爆炸饼点?

1 个答案:

答案 0 :(得分:0)

我不知道这是否会对你有所帮助,但是在转动积分之前尝试对图表进行数据绑定&#34;爆炸&#34;为假。如下例所示:

Chart1.Databind();
Chart1.Series["Series1"].Points[0]["Exploded"] = "false";