如何在弹出窗口中显示图形细节? [英] How to display graph details in a popup window?
问题描述
您好,
点击柱形图中的某个点后,我需要显示一个包含详细信息的弹出窗口。 例如,有员工列表,如果点击了emp_id 5,则会在弹出窗口中显示emp_id 5的所有详细信息。
我尝试调用js函数在此事件中创建一个弹出窗口,但回发导致图形在用户点击后消失。
有谁知道 我是如何使它运作的? 任何帮助或建议都是非常欣赏的。
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);
}
}
以下是我的HTML标记代码:
< asp:Chart ID =" Chart1" RUNAT = QUOT;服务器"宽度= QUOT; 850像素"高度= QUOT; 230"的OnClick = QUOT; chrt_Click">
< Series>
< asp:Series Name =" Series1" IsValueShownAsLabel = QUOT;真" PostBackValue = QUOT;#VALX" />
< / Series>
< ChartAreas>
< asp:ChartArea Name =" ChartArea1" />
< / ChartAreas>
< / asp:Chart>
看一下
样本环境 (主要是交互性和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
这篇关于如何在弹出窗口中显示图形细节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!