basis on data, how to generate javascript code for graph
I am creating chart in Asp.net c#
I want to pass value in the javascript function from backend(C# page.Cs page).
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script src="jquery/jquery-1.7.2.min.js"></script>
<title></title>
<script type="text/javascript">
$(function () {
$('#container').highcharts({
chart: {
type: 'pie'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function () {
location.href = this.options.url;
}
}
}
}
},
series: [{
data: [{
y: 29.9,
url: 'https://www.google.com/gmail/about/#'
}, {
y: 71.5,
url: 'https://www.google.com/'
}, {
y: 106.4,
url: 'http://yahoo.com/'
}]
}]
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Label id="lblFunction" runat="server" />
<div id="container" runat="server" style="height: 400px"></div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Graph_Chart
{
public partial class Pie_Chart : System.Web.UI.Page
{
string FunctionValue = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
lblFunction.Text = "$(function (){$('#container').highcharts({chart:{type: 'pie'},xAxis:{categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']},plotOptions:{series:{cursor: 'pointer',point:{events:{click: function() {location.href = this.options.url;}}}}},series: [{data: [{y: 29.9,url: 'https://www.google.com/gmail/about/#'}, {y: 71.5,url: 'https://www.google.com/'}, {y: 106.4,url: 'http://yahoo.com/'}]}]});});";
}
//I want to pass value for javascript function
}
}