且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在弹出窗口中显示图形细节?

更新时间:2022-10-24 20:15:26

看一下
样本环境
(主要是交互性和AJAX部分)


你可以试试这样的例子:

 Chart1.Series(" Series1")。MapAreaAttributes =" onclick ="" testFunction('#SER',#INDEX);""" 
Chart1.Series(" Series1")。Url ="#" '只是为了得到"手"光标


Hello,

I need to display a popup window with details when a point in column chart got clicked.  For example, there is list of employees, if emp_id 5 is clicked, all the details of emp_id 5 gets displayed in the popup window. 

I tried calling a js function to create a popup in this event but the postback is causing the graph to disappear once the user clicks on it.

Does anyone know how i can make it work?   Any help or suggestions is greately apprecited.

protected void chrt_Click(object sender, ImageMapEventArgs e) { var doorNumber = e.PostBackValue; var xStr = 100; var yStr = 200; string script = String.Format("test({0},{1})", xStr, yStr); this.Page.ClientScript.RegisterStartupScript(this.GetType(), "testFunction", script, true); } } Below is my HTML markup code:

<asp:Chart ID="Chart1" runat="server" Width="850px" Height="230" OnClick="chrt_Click"> <Series> <asp:Series Name="Series1" IsValueShownAsLabel="true" PostBackValue="#VALX" /> </Series> <ChartAreas> <asp:ChartArea Name="ChartArea1" /> </ChartAreas> </asp:Chart>


Have a look at the Samples Environment (Mainly the Interactivity and AJAX section).

You could try something like this for example:

Chart1.Series("Series1").MapAreaAttributes = "onclick=""testFunction('#SER', #INDEX);"""
Chart1.Series("Series1").Url = "#" 'Just to get the "hand" cursor