如何更改d3.js和angular-charts.js中的颜色?

时间:2017-08-03 10:24:13

标签: javascript angularjs d3.js angular-chart

我是D3.js和angular-charis.js的新手

我的数据

$scope.data1 = { series: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'], data: [{x:'Jan',y:[12150]},{x:'Feb',y:[0]},{x:'Mar',y:[10]},{x:'Apr',y:[64]},{x:'May',y:[2381]},{x:'Jun',y:[578]},{x:'Jul',y:[312]},{x:'Aug',y:[0]},{x:'Sep',y:[8700]},{x:'Oct',y:[17540]},{x:'Nov',y:[20190]},{x:'Dec',y:[1467]}] };

$scope.config = {
title: '',
tooltips: true,
labels: false,
mouseover: function() {},
mouseout: function() {},
click: function() {},
legend: {
  display: true,
  //could be 'left, right'
  position: 'right'
}

};

HTML

 <div id="chart1" ac-chart="'bar'" ac-data="data1" ac-config="config1" class="grpah-section"></div>

我的结果显示得很明智:

enter image description here

但是,我希望结果显示每个单独的X轴条显示根据月份指示颜色的颜色

0 个答案:

没有答案