From 7bb996203f9df7aaffa1720ffb6d104217759d89 Mon Sep 17 00:00:00 2001 From: corpglory-dev Date: Wed, 20 Feb 2019 16:30:55 +0300 Subject: [PATCH] get label and color from series --- public/app/plugins/panel/piechart/PiechartPanel.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/public/app/plugins/panel/piechart/PiechartPanel.tsx b/public/app/plugins/panel/piechart/PiechartPanel.tsx index 4398bbce7db..36fea492a3e 100644 --- a/public/app/plugins/panel/piechart/PiechartPanel.tsx +++ b/public/app/plugins/panel/piechart/PiechartPanel.tsx @@ -25,17 +25,16 @@ export class PiechartPanel extends PureComponent { nullValueMode: NullValueMode.Null, }); - vmSeries.forEach(serie => { + for (let i = 0; i < vmSeries.length; i++) { + const serie = vmSeries[i]; if (serie) { datapoints.push({ value: serie.stats[valueOptions.stat], - // TODO: get name - name: 'tmpName', - // TODO: add color option - color: 'tmpColor', + name: serie.label, + color: serie.color, }); } - }); + } } // TODO: support table data