score:3
Accepted answer
that is because when you define a scope object in your directive, it creates an isolate scope for that directive. that means, the scope within your directive cannot access the scope properties defined outside. you have your controller defined on the outer scope where you attach the function updatechart
. so, your isolate scope directive is not aware of this method.
to fix this, you can define a controller on your directive itself. and in that controller, define the method updatechart
.directive('changechart', function() {
return {
restrict: 'e',
scope: {
name: '@'
},
controller: function ($scope) {
$scope.updatechart = function(id, type) {
var chart = $('#' + id).highcharts();
chart.series[0].update({
type: type
});
};
},
templateurl: "change-chart.html"
};
})
Source: stackoverflow.com
Related Query
- Using directive scope to update Highcharts
- Update Chart Colors When Using Styled HighCharts Version
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Query rails database, and update highcharts using Javascript
- How to dynamically update highcharts using jQuery UI sliders
- Highcharts - update chart using ajax
- Highcharts smooth transition on data update using Angular and ng-highcharts
- Highcharts Solid Gauge Dynamic Update Using JSON
- Highcharts display label for pie chart using html table as data source
- Update series using Highcharts React wrapper
- Getting Highcharts tooltip to return an angular directive using templeteUrl?
- HTML table as data source for highstock charts using highcharts
- add chart using highcharts to angular via highcharts-ng directive
- Using a flask variable as data source for highcharts
- Update Tooltip onclick using customButton Highcharts
- Highcharts can not update diagram using angular.js
- How to update the HighCharts title using drill-up when there are multiple charts on same page?
- having issue when updation Highcharts object using highcharts-ng directive
- Highcharts data will not load using angular directive
- How do I set multiple unique charts in their own DIVs using an AngularJS directive and Highcharts
- How to create a column range chart in Highcharts using range and navigator functions?
- Rendering Highcharts using Angular js Directives
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- Hiding a Highcharts series without using the legend
- Loading Highcharts via shim using RequireJS and maintaining jQuery dependency
- SyntaxError: JSON.parse: expected property name or '}' while using highcharts
- How do I dynamically change a data point in Highcharts using JavaScript
- Type 'number[]' has no properties in common with type 'XrangePointOptionsObject' in Angular8 using Highcharts
- Getting error while using highcharts in Angular 7
- Dynamically update subtitle on Highcharts chart?
More Query from same tag
- HighCharts – Horizontal chart: moving bars down, make space for labels above them
- Datatable Highcharts
- HighCharts TypeError: ha is not a function
- Using Highcharts with mysql for Page Visits
- How do you reduce the space between pie chart and legend? (highcharts.js)
- Highcharts sticky labels for big values goes out of chart
- How to have different cursor style for legends in Highcharts?
- Highcharts / Highstock scroll to right
- Highcharts and JSON parameters
- Highchart Data from HTML table with <input> values
- Highcharts yAxis title click
- Highlighting last column in Highcharts
- How to add highcharts-more.src.js to an angular2 project?
- NodeJS highchart save png
- Function not working from particular context in angular
- Highcharts zoom issue when panning reversed xAxis
- HighChart Legends Overcome on charts
- HighCharts load data via Json
- get access to chart-object in highchart
- Highcharts - drill down to multiple series in R
- How can I change the text of the back button on this dropdown pie chart?
- Building dynamic HighCharts and image Highcharts with (mostly) one codebase?
- HighChart Tooltip different suffix values
- Export HighChart 3D pie chart into png is not working
- highcharts now showing with activemq's amq
- Custom HighCharts - change the height of plotLines , show the marker value by default at a specific x and y
- highcharts groups of stacked columns
- Highchart json from mysql data not able to show up in line graph
- How to add a custom candlestick to highchart stock chart?
- How to use HighChart.getOption() with react-native-highchart