cra-template-jsdashboard
Advanced tools
Comparing version
{ | ||
"name": "cra-template-jsdashboard", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "template.json", |
@@ -59,2 +59,3 @@ function print_filter(filter) { | ||
//BAR CHART | ||
var companiesKey = "Companies::Name"; | ||
@@ -83,3 +84,23 @@ var companiesDim = facts.dimension(function (d) { | ||
var regionsKey = "Companies::Region"; | ||
var regionsDim = facts.dimension(function (d) { | ||
return d.fieldData[regionsKey]; | ||
}); | ||
var regionsGroup = regionsDim.group(); | ||
window.regionsPieChart = dc.pieChart("#regionsPieChart"); | ||
regionsPieChart | ||
.dimension(regionsDim) | ||
.group(regionsGroup) | ||
.slicesCap(4) | ||
.height(150) | ||
.ordinalColors(d3.schemeDark2) | ||
.legend( | ||
dc.legend().legendText(function (d) { | ||
// console.log(d) | ||
return d.name + " || " + d.data; | ||
}) | ||
); | ||
dc.renderAll(); | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
144
15.2%3256719
-0.1%