Я работаю в AngularJS проекта, и я пытаюсь добавить диаграмму Google Ганта с angular-google-chart
инструментом, но он не работает.Неверный тип визуализации: Ганта с угловым-Google-диаграммы
Вот код:
JS КОД
var app = angular.module('myApp', [
'ngRoute',
'angular.filter',
'googlechart'
]);
app.value('googleChartApiConfig', {
version: '1.1',
optionalSettings: {
packages: ['gantt'],
language: 'en'
}
});
app.controller("chartController", function ($scope) {
$scope.ganttChart = {
"type": "gantt",
"data": {
"cols": [
{id: 'Task ID', type: 'string'},
{id: 'Task Name', type: 'string'},
{id: 'Start Date', type: 'date'},
{id: 'End Date', type: 'date'},
{id: 'Duration', type: 'number'},
{id: 'Percent Complete', type: 'number'},
{id: 'Dependencies', type: 'string'}
],
"rows": [
{c: [
{v: 'Research'},
{v: 'Find sources'},
{v: new Date(2015, 0, 1)},
{v: new Date(2015, 0, 5)},
{v: null},
{v: 100},
{v: null}
]},
{c: [
{v: 'Write'},
{v: 'Write paper'},
{v: null},
{v: new Date(2015, 0, 9)},
{v: daysToMilliseconds(3)},
{v: 25},
{v: 'Research'}
]}
]
}
};
});
function daysToMilliseconds(days) {
return days * 24 * 60 * 60 * 1000;
}
HTML КОД
<div google-chart chart="ganttChart" style="height:600px; width:100%;"></div>
При запуске приложения, вместо того, чтобы показывать диаграмму, Недопустимый тип визуализации : появляется gantt, а c onsole не отображаются ошибки.
Я попробовал этот состав данных в этом Fiddle (пример Google Диаграмма Ганта, нет angular-google-chart
инструмента) и она отлично работает.
Может кто-нибудь мне помочь? Спасибо! И извините за мой английский!