I am passing JSON data to my bar chart and data is based on dropdown value. So on change of drop down graph value should change. it is changing but when we hover last visited value is coming bar chart is shaking too. Please give your suggestion.
<div class="col_half" id="subSectionalChart" style="opacity: 0;">
<canvas id="subSectionalChartCanvas" width="547" height="400"></canvas>
</div>
function subSectionalGraphCall(data){
var livelabels=[];
var livedata=[];
for(var i=0; i<data.length; i++){
livelabels.push(data[i].subSectionVisited);
livedata.push(data[i].subSectionCount);
}
var options = {
scaleBeginAtZero : true,
scaleShowGridLines : true,
scaleOverlay: false,
scaleShowGridLines: true,
scaleGridLineColor : "rgba(0,0,0,.05)",
scaleGridLineWidth : 1,
scaleShowHorizontalLines: true,
scaleShowVerticalLines: true,
barShowStroke : true,
barStrokeWidth : 2,
barValueSpacing : 5,
barDatasetSpacing : 1,
};
var barChartData = {
labels : livelabels,
datasets : [
{
fillColor : "rgba(200,147,165,0.5)",
strokeColor : "rgba(151,187,205,1)",
data : livedata,
}
]
};
function show(){
var ctx = document.getElementById("subSectionalChartCanvas").getContext("2d");
new Chart(ctx).Bar(barChartData,options);
}
$('#subSectionalChart').appear( function(){ $(this).css({ opacity: 1 }); setTimeout(show,300); },{accX: 20, accY: -10},'easeInCubic');
}