asp.net 차트 컨트롤에서 JS window.open 명령을 실행하고 있지만 해고되지 않습니다.asp.net 차트 컨트롤에서 새 창 열기
다음은 피라미드를 작성하는 .aspx 페이지의 코드입니다.
<div>
<asp:Chart ID="Chart1" runat="server" Height="416px" ImageType="Jpeg"
Width="525px" IsMapAreaAttributesEncoded="True" Palette="None"
PaletteCustomColors="Navy; DarkBlue; DarkBlue; DarkBlue; DarkBlue; DarkBlue; DarkBlue"
TextAntiAliasingQuality="SystemDefault" ImageStorageMode="UseImageLocation">
<Series>
<asp:Series BackGradientStyle="DiagonalRight" BackSecondaryColor="Black"
BorderColor="Black" ChartType="Pyramid" Color="Transparent"
CustomProperties="Pyramid3DRotationAngle=8, PyramidMinPointHeight=60, PyramidPointGap=3, PyramidLabelStyle=Inside"
Font="Verdana, 8pt, style=Bold" IsValueShownAsLabel="True" Name="Series1"
ShadowColor="Black" LabelForeColor="White" Palette="Grayscale">
<Points>
<asp:DataPoint CustomProperties="PyramidInsideLabelAlignment=Top"
Label=" xxxxxx Column-1"
ToolTip="1111" YValues="40"/>
<asp:DataPoint CustomProperties="PyramidInsideLabelAlignment=Top"
Label="xxxxxx Column-2" MapAreaAttributes="" ToolTip="2222"
YValues="40" />
<asp:DataPoint CustomProperties="PyramidInsideLabelAlignment=Top"
Label="xxxxxx Column-3" MapAreaAttributes="" ToolTip="" Url=""
YValues="40" />
<asp:DataPoint CustomProperties="PyramidInsideLabelAlignment=Top"
Label=" xxxxxx Col4" MapAreaAttributes="" ToolTip="" Url=""
YValues="40" />
<asp:DataPoint
Label=" xxxxxx Col5" MapAreaAttributes="" ToolTip="" Url=""
YValues="40" />
<asp:DataPoint Label=" xxxxxx Col6" MapAreaAttributes="onClick='javascript:OpenPage();'" ToolTip="" Url=""
YValues="40" />
<asp:DataPoint CustomProperties="PyramidInsideLabelAlignment=Bottom"
Label="xx Col7" MapAreaAttributes="" ToolTip="" Url="" YValues="40" />
</Points>
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
<Area3DStyle Enable3D="True" IsRightAngleAxes="False" Perspective="30"
Inclination="45" PointGapDepth="1000" Rotation="60" />
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
</div>
아래 코드는 뒤에 있습니다.
protected void Page_Load(object sender, EventArgs e)
{
string statusClicked = string.Empty;
Series series = new Series("MySeries");
series.ChartType = SeriesChartType.Pyramid;
series.BorderWidth = 3;
DataTable dt = new DataTable();
dt.Columns.Add("Column-1", typeof(int));
dt.Columns.Add("Column-2", typeof(int));
dt.Columns.Add("Column-3.", typeof(int));
dt.Columns.Add("Column-4", typeof(int));
dt.Columns.Add("Column-5", typeof(int));
dt.Columns.Add("Column-6", typeof(int));
dt.Columns.Add("Column-7", typeof(int));
dt.Rows.Add(1400, 2240, 7660, 3410, 15, 4, 9);
int colCount = dt.Columns.Count;
List<string> xaxis = new List<string>();
List<double> yaxis = new List<double>();
Chart1.Series[0].Points[0].MapAreaAttributes = "onclick=\"javascript:window.open('http://www.google.com');\"";
}
이상적으로 차트의 모든 시리즈의 클릭에 구글 링크가 열려 받아야하고 할당 된 상태 코드에서 얻은 하나를 바램. 그러나 코드는 작동하지 않습니다.
열리는 URL은 다음과 같습니다. 여기
http://localhost:1450/javascript%3avar+win%3dwindow.open('http%3a%2f%2fwww.google.com%3fstatus%3dTestStatus')%3b
당신이 상태가 http://www.google.com/?status=TestStatus
주를 열어야 테스트 상태 등 링크임을 알 수있는 다음 labelURL 속성은 URL 만 걸릴 것이다.
에 대한 MapAreaAttributes을 사용할 수 있나요 window.open 구문 코드 (1) 정확한 작성? –
코멘트가 없습니다 ???? 제발 도와주세요. –
도와주세요! –