Skip to content

Commit

Permalink
Merge pull request #30 from devinit/feature/charts-feedback
Browse files Browse the repository at this point in the history
 Make more edits for column and map charts
  • Loading branch information
ThatcherK authored Mar 24, 2023
2 parents a6058ca + 96b54fd commit 56f6888
Show file tree
Hide file tree
Showing 5 changed files with 453 additions and 449 deletions.
2 changes: 1 addition & 1 deletion assets/core.js

Large diffs are not rendered by default.

Binary file modified src/.DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions src/core/EconomicPovertyBarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getSeriesNames = (data) => Array.from(new Set(data.map((item) => item['Reg
const getSeries = (dataArray, years, filterValue) => {
const seriesNames = getSeriesNames(dataArray);
const series = seriesNames.map((seriesName) => ({
name: seriesName === 'Other High Income Countries' ? 'Other High-Income Countries' : seriesName,
name: seriesName === 'Other High Income Countries' ? 'Other high-income countries*' : seriesName,
type: 'bar',
stack: 'Region',
tooltip: {
Expand All @@ -30,14 +30,14 @@ const getSeries = (dataArray, years, filterValue) => {
.filter((item) => item['poverty line (2017 PPP)'] === filterValue)
.forEach((item) => {
if (item['Region name'] === seriesName && item.year === year) {
yearList.push(Number(Number(item['Population in poverty (billions)']).toFixed(2)));
yearList.push(Number(Number(item['Population in poverty (billions)'])));
}
});

const accumulatedYearValue = yearList.reduce((accumulator, currentValue) => accumulator + currentValue, 0);

return {
value: accumulatedYearValue.toFixed(2),
value: accumulatedYearValue.toFixed(3),
emphasis: {
focus: 'self',
},
Expand Down
Loading

0 comments on commit 56f6888

Please sign in to comment.