It seems your problem has nothing to do with AngularJS itself. You can transform data using lodash or underscore.
Here is an example built using lodash (btw, I added one more array element to show how groupBy works):
var docs = [
{
id: 15,
nom: "azerty",
type: "azerty",
quantity: 456,
prix: 25296
},
{
id: 21,
nom: "sdqs",
type: "qsdqsd",
quantity: 102,
prix: 52
},
{
id: 22,
nom: "sdqs",
type: "qsdqsd",
quantity: 99,
prix: 52
}
];
var newDocs = _.map(docs, function(x) {return {type: x.type, quantity: x.quantity};});
var result = _.groupBy(newDocs, 'type');
console.log(result);
And the output looks like this:
{"azerty":[{"type":"azerty","quantity":456}],"qsdqsd":[{"type":"qsdqsd","quantity":102},{"type":"qsdqsd","quantity":99}]}
Not sure what kind of chart library do you use and what input it expects but with lodash you will be for sure able to shape your data in any possible form.
UPDATE:
BTW, if you change map function a bit you can get type->quantity mapping as array (don't copy my code style :) ):
var newDocs = _.map(docs, function(x) {var tmp = {}; tmp[x.type] = x.quantity; return tmp;});
Output is the following:
[{"azerty":456},{"qsdqsd":102},{"qsdqsd":99}]
quantity, what do you want to do with it? Do you want to add it to your scope? Show it in your view? Can you post more of your code/give more context?