How do you wrap a function ?
i have asked this before, but am trying to make this question as simple as possible.
So this is the code I need to wrap :
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
yAxis: {
title: {
text: 'Fruit eaten'
}
},
series: [{
name: 'Jane',
data: [1, 0, 4]
}, {
name: 'John',
data: [5, 7, 3]
}]
});
});
div:
<div id="container" style="width:340px; height:270px;"></div>
I was told I can put this into a wrap and then call the function. How can this be done?
This data is dummy, my data is coming from the server. What i want is to redraw the chart in code behind so it refreshes the data, using RegisterClientScriptBlock.
but for this, i first need to wrap the function...
i have this, but get error:
Dim someScript As String = "<script language='javascript'>container1_highcharts();</script>"
Page.ClientScript.RegisterStartupScript(Me.[GetType](), "onload", someScript)
error:
Uncaught ReferenceError: container_highcharts is not defined