score:5
Accepted answer
Shouldn't be ng-click passing the data like this
<uib-accordion-heading ng-click="open({{data.id}})" class="header">
Then in open function,
function open(id) {
$http({ ..... });
}
score:1
How about creating a new directive for the chart where you create the chart option and the chart container there.
<example-highchart></example-highchart>
exampleHighchart.js
(function() {
'use strict';
angular
.module('yourModule')
.directive('exampleHighchart', exampleHighchart);
function exampleHighchart() {
return {
templateUrl: 'example-highchart.template.html',
restrict: 'E',
scope: {
id: '='
},
replace: 'true',
link: linkFn
};
function linkFn(scope, element) {
element.find('.highchart-element').highcharts(createOptions());
function createOptions() {
// your chart option goes here
}
function updateChartData() {
// you can start the loading animation here
// and then hide it in the the then block
// get the highchart element reference to update the properties.
var chart = element.find('.highchart-element').highcharts();
$http({
method: "GET",
url: "/api/Board/getMapdataOnId",
params: {
id: parseInt(id)
}
}).then(function (response) {
var boardData = response.data;
var dateData = [], rateData = [];
for (var i = 0; i < boardData.gData.length; i++) {
dateData.push(Date.parse(boardData.gData[i].date));
rateData.push(boardData.gData[i].maxRate);
}
// update the categories info and the series data
chart.xAxis[0].setCategories(dateData);
chart.series[0].setData(rateData);
});
}
}
}
})();
highchart-example.template.html:
<div>
<!-- you can add your loading gif here and display it while it's loading -->
<div class="example-highchart" />
<div>
score:1
Don't call ng-click as
<uib-accordion-heading ng-click="open({{data.id}})" class="header">
it should be as
<uib-accordion-heading ng-click="open(data.id)" class="header">
Source: stackoverflow.com
Related Query
- How to Load HighChart dynamically within angular UI Accorion(uib-Accordion)?
- How to load a highchart script within a WebPartZone
- How to draw HighChart XAxis dynamically
- How to dynamically change axis from linear to logarithmic in HighChart
- How to dynamically load highcharts
- Angular Highcharts - How to enable noData options and update it dynamically
- How to fill data dynamically in Highchart
- Is there a way how to dynamically create a plotline in highchart when the value is lower than previous one?
- How to Build a Column Chart in Highcharts with Data Entered Dynamically Within a CMS
- Highchart is not resizing dynamically when used as a angular directive
- how to dynamically change column chart to mirror chart using highchart
- How to use highchart 3d with angular 5?
- How do I open a new window / tab by clicking on a column / bar within a Highchart graph?
- How to add a new Highchart dynamically using Highchartsng
- How to populate a Highchart graph with Angular
- How to load highcharts annotations module in angular module app.module.ts?
- Angular Highcharts - How to clone chart dynamically
- how to add height and width to highchart dynamically
- How to create doughnut highchart using angular JS
- How To Load Plist Data On HighChart Using Objective C?
- Change Highchart Options dynamically in angular
- how to make bubble chart in highchart selected a bubble on load
- How to implement Highchart in AngularJS.i was trouble with implementation highchart in angular
- Highchart - How do I create the attached image gauge within a semicircle pie chart
- How to invert (transpose) the rows and columns of an HTML table which is generated dynamically from highchair in Angular 12?
- Angular 7 Highchart Node.marker not working on page load
- How to show series dataLabels inside the Highchart pyramid in angular
- how to load data from server with highchart inAngular 2?
- How to dynamically resize a highslide popup called from a Highchart graph using jquery?
- How to change JSON Format For load data to Highchart
More Query from same tag
- How can I have both a legend and data labels, with different labels, in Highcharts?
- Highcharts ajax load
- Highcharts Change Bar Background Color Based on categories value
- Highcharts no drilldown on bar / column click
- Highmaps - how i can have a seperate legend by different report?
- Not able to disable legend title / enable legend title as required while expoting Highcharts
- Is a 1D flag chart possible?
- How to show the json data in Pie chart HighChart?
- Highcharts live graph setExtremes issue
- Highstock: How can I format the xAxis crosshair label?
- Highcharts-browserify desn't work
- How is the api doc generated @ http://api.highcharts.com/
- JSON parse or removing double quotation in data getting form model or database in rails
- Yaxis Values on High Chart Customization
- Highchart data rendering underneath Bootstrap Popover
- Highcharts:add click event on data label for pie chart
- With HighCharts, how can I have the same tooltip formatter as my y axis
- Have some bars not a url link on highcharts
- Padding between categories in bar chart
- Highcharts.js How to put current time label in the end of xAxis
- How to add two different mouse over for two different type of series in same chart?
- Onclick download the highchart
- passing formatting JavaScript code to HighCharts with JSON
- how to add an color picker control to highchart for changing the color of series by user
- Display Stack label Highcharts
- Highcharts convert x-axis time to localtime
- Moving Average Line in Highcharts Scattered Chart
- Update Series Array on HighChart after editing chart
- How to format dates in Highcharts on x-axis?
- Put two Highcharts Charts Side by Side on a Jekyll Blog (beautiful-jekyll)