2016-10-04 2 views
2
내 이온 응용 프로그램에서 각도 라인 차트 기능을 구현하고

와 각도 차트에 표시되지 만, 차트 아래의 시리즈 세부 사항은 표시되지 않음 (어떤 색이 어떤 선을 나타내는 지의 의미)시리즈 세부 사항 Charts.js

차트 계열 필드를 전달하지만 여전히 표시되지 않습니다. 친절히 조언하십시오.

여기 index.html을 여기

<ion-content ng-controller="ExampleCtrl"> 
    <div class="card"> 
     <div class="item item-divider"> 
      This is a Line Chart 
     </div> 
     <div class="item item-text-wrap"> 
      <canvas id="line" class="chart chart-line" chart-data="data" chart-labels="labels" chart-series="series" chart-options="options" chart-legend="true" 
      chart-dataset-override="datasetOverride" chart-click="onClick"> 
      </canvas> 
     </div> 
    </div>   
    </ion-content> 

입니다 내

angular.module('starter', ['ionic', 'chart.js']) 

.run(function($ionicPlatform) { 
$ionicPlatform.ready(function() { 
if(window.cordova && window.cordova.plugins.Keyboard) { 
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard 
    // for form inputs) 
    cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); 

    // Don't remove this line unless you know what you are doing. It stops the viewport 
    // from snapping when text inputs are focused. Ionic handles this internally for 
    // a much nicer keyboard experience. 
    cordova.plugins.Keyboard.disableScroll(true); 
} 
if(window.StatusBar) { 
    StatusBar.styleDefault(); 
} 
}); 
}) 

.controller("ExampleCtrl", function($scope){ 
$scope.labels = ["January", "February", "March", "April", "May", "June", "July"]; 
$scope.series = ['Series A', 'Series B']; 
$scope.data = [ 
    [65, 59, 80, 81, 56, 55, 40], 
    [28, 48, 40, 19, 86, 27, 90] 
]; 

}); 

답변

10

당신은 전설이 사실 표시 설정해야 app.js. 그게 당신의 문제를 해결할 것입니다

$scope.labels = ["January", "February", "March", "April", "May", "June", "July"]; 
$scope.series = ['Series A', 'Series B']; 
$scope.options = { legend: { display: true } }; // missing 

$scope.data = [ 
    [65, 59, 80, 81, 56, 55, 40], 
    [28, 48, 40, 19, 86, 27, 90] 
]; 

희망이 문제를 해결할 수 있습니다. 감사합니다

+0

고마워요 ... 젠장, 내가 제대로 문서를 읽었어야했다. –

+0

나는이 문서가 실제로 필요한 구성을 포함하고 싶습니다. 나는 미쳐 가고 있다고 생각했습니다. – Dan