Zingchart with angular directive

I use zingchart with angular, it works fine when I show the chart on one page, but when I try to include the template with zingchart in the tab, it does not appear, and I have no errors in the browser console,

HTML:

<div zingchart id="chart-1" zc-json="myJson"></div>

CONTROLLER viewing zingchart:

$scope.myJson = {
type: "line",
series : [
                    {
                        values : data1,
                        text : "A",
                        lineColor : "#00ACF2",
                        marker : {
                            borderColor : "#00ACF2"
                        }
                    },
                    {
                        values : data2,
                        text : "B",
                        lineColor : "#86CA00",
                        marker : {
                            borderColor: "#86CA00"
                        }
                    }
                ]
};

CONTROLLER, which I use to enable my view with zingchart:

$templateRequest(template).then(function (html) { 
var template = angular.element(html); 
contenu = $compile(template)($scope); 
$timeout(function () { $('#onglet').append(contenu); }, 100); 
});

thank

+4
source share

Source: https://habr.com/ru/post/1649006/


All Articles