Doughnut Kind chart with multiple series

3

I'm using Angular Charts to plot a Donut chart; my code is structured as follows:

$scope.data = [
['abc', 'def'],
['fgh', 'ijk'],
];
$scope.labels = ['Ask', 'Bid'];
$socpe.series = ['Volume Ask', 'Volume Bid'];
$scope.color = ['#66ff33', '#ffff00'];

The code above results in something like the following image:

However,whatIneedisachartwherethecolorsareshownasfollows:

As you can see, the code is assigning one color per series and what I need is a graphic with two colors per series.

Does anyone know if it's possible to create something like this using Angular Charts?

Thankful, Arnaut

    
asked by anonymous 26.12.2016 / 13:08

1 answer

1

The solution is in the following code:

 $scope.datasetOverride = [{
  fill: true,
  backgroundColor: [
    "#66ff33",
    "#36A2EB",
    "#FFCE56"
  ]
}, {
  fill: true,
  backgroundColor: [
    "#ffff00",
    "#46BFBD",
    "#FDB45C"
  ]
}];

DEMO

Answered in: link

    
27.12.2016 / 02:58