-
Notifications
You must be signed in to change notification settings - Fork 83
problem getting chartjs object in controller #30
Comments
The chart will most likely be Try the following and see if it shows you when chart object is there: $scope.myChart = null
$scope.$watch("myChart", function(myChart) {
// do something
console.log('myChart', myChart);
console.log('$scope.myChart', $scope.myChart);
} There are a handful of problems surrounding accessing the chartjs object, and i think we are in need of some improvements for exposing the chart and potentially the ability to bind onclick events to points/segments. |
Have a look at #19 as it may be related. Also make sure bower is installing the correct version of Chart.js. |
I added watch on based on #19 I checked my {
"name" : "MySampleApp",
"private" : true,
"dependencies" : {
...
"angular" : "1.2.x",
"Chart.js" : "~1.0.1",
"tc-angular-chartjs" : "~1.0.9",
...
}
} |
hmm, I'm not sure what's going wrong then. Take a look at this example, and see if you can implement this and get it working. |
I had this issue only on minified (uglified) js assets. |
based on issue #6 i added
chart
attribute to my canvas:and in my controller wanted to access
chartjs
object:but when
onButtonClicked
function executed,$scope.myChart
is stillnull
and I cant access tochartjs
object in my controller.The text was updated successfully, but these errors were encountered: