I have stored the controller function return value in the one "colors" variable ,And I have the static bar charts ,now I want to launch the barcharts with the help of colors variable data.
What I have tried:
function onChangeId(event) {
jQuery.ajax({
url: "Home/PopulateValues",
type: 'POST',
data: { ipaddress: event.value },
success: function (result) {
colors = JSON.parse(result);
$("#div1").text(colors[0].Item2);
$("#div2").text(colors[0].Item3);
}
now I wanna to send this colors data to the static bar chats,the bar chat has to populate with the colors data.
Barcart.html:
script>
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'column',
backgroundColor: '#eee',
plotBackgroundColor: '#fff',
},
credits: { enabled: false },
title: {
text: 'Histogram Chart'
},
subtitle: {
text: '<p style="color:red">Chart For Total Impressions</p>'
},
tooltip: {
borderWidth: 1,
formatter: function () {
return this.x + '<br/>' +
'Count: ' + this.y;
}
},
plotOptions: {
column: {
shadow: false,
borderWidth: .5,
borderColor: '#666',
pointPadding: 0,
groupPadding: 0,
color: 'rgba(204,204,204,.85)'
}
},
xAxis: {
categories: ['Color', 'B&W', 'B&W printed on<br> color printer'],
labels: {
style: {
fontSize: '15px',
fontWeight: 'normal',
color: '#488'
},
},
lineWidth: 0,
lineColor: '#999',
tickLength: 70,
tickColor: '#ccc',
},
yAxis: {
title: { text: 'Impressions' },
tickColor: '#ccc',
lineColor: '#ccc',
},
series: [{
name: 'Histogram',
data: [234, 418, 126],
}]
});
</script>