This sample shows how to set the chart data point hyperlinks.
For detailed implementation, please take a look at the Aspx code tab.
<%@ Page Language="C#" %>
<%@ Register assembly="JQChart.Web" namespace="JQChart.Web.UI.WebControls" tagprefix="jqChart" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<link rel="stylesheet" type="text/css" href="~/Content/jquery.jqChart.css" />
<link rel="stylesheet" type="text/css" href="~/Content/themes/le-frog/jquery-ui-1.8.20.css" />
<script src="<% = ResolveUrl("~/Scripts/jquery-1.11.1.min.js") %>" type="text/javascript"></script>
<script src="<% = ResolveUrl("~/Scripts/jquery.jqChart.min.js") %>" type="text/javascript"></script>
</head>
<body>
<form runat="server">
<jqChart:Chart ID="Chart1" Width="500px" Height="300px" runat="server">
<Title Text="Hyperlinks"></Title>
<Animation Enabled="True" Duration="00:00:01" />
<Series>
<jqChart:ColumnSeries Title="Measure" Cursor="Pointer">
<XValues>
<jqChart:StringValue Value="Google" />
<jqChart:StringValue Value="Yahoo" />
<jqChart:StringValue Value="Bing" />
</XValues>
<YValues>
<jqChart:DoubleValue Value="70" />
<jqChart:DoubleValue Value="40" />
<jqChart:DoubleValue Value="85" />
</YValues>
<CustomValues>
<jqChart:StringValue Value="www.google.com" />
<jqChart:StringValue Value="www.yahoo.com" />
<jqChart:StringValue Value="www.bing.com" />
</CustomValues>
</jqChart:ColumnSeries>
</Series>
</jqChart:Chart>
<script lang="javascript" type="text/javascript">
$(document).ready(function () {
$('#<%= Chart1.ClientID %>').bind('dataPointMouseDown', function (event, data) {
var link = data.series.customData[data.index];
window.open('http://' + link);
});
});
</script>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace SamplesBrowser.Models
{
public class EmptyChartModel
{
}
}