2013-09-25 42 views
0

我試圖在餅圖中爆炸或爆炸爆炸點。
但是,當我爆炸一個點時,它'知道'它會爆炸,但它不會在圖表上出現。質譜圖控制不爆炸餅點

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"使點看起來爆炸,但不會爆炸/不爆炸它們。

我該如何爆炸或爆炸爆炸點?

回答

0

我不知道這是否會幫助你,但在將點「爆炸」變爲假前,嘗試數據綁定圖表。如下例所示:

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