Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: donut chart #3355

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/VisualizationTypeSelector/ListItemIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
VIS_TYPE_AREA,
VIS_TYPE_STACKED_AREA,
VIS_TYPE_PIE,
VIS_TYPE_DONUT,

Check failure on line 10 in src/components/VisualizationTypeSelector/ListItemIcon.js

View workflow job for this annotation

GitHub Actions / lint

VIS_TYPE_DONUT not found in '@dhis2/analytics'
VIS_TYPE_RADAR,
VIS_TYPE_GAUGE,
VIS_TYPE_YEAR_OVER_YEAR_LINE,
Expand Down Expand Up @@ -46,6 +47,8 @@
return <StackedBarIcon style={style} />
case VIS_TYPE_PIE:
return <PieIcon style={style} />
case VIS_TYPE_DONUT:
return <PieIcon style={style} />
case VIS_TYPE_GAUGE:
return <GaugeIcon style={style} />
case VIS_TYPE_LINE:
Expand Down
2 changes: 2 additions & 0 deletions src/modules/layoutValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
VIS_TYPE_YEAR_OVER_YEAR_LINE,
VIS_TYPE_YEAR_OVER_YEAR_COLUMN,
VIS_TYPE_PIE,
VIS_TYPE_DONUT,

Check failure on line 7 in src/modules/layoutValidation.js

View workflow job for this annotation

GitHub Actions / lint

VIS_TYPE_DONUT not found in '@dhis2/analytics'
VIS_TYPE_GAUGE,
VIS_TYPE_SINGLE_VALUE,
VIS_TYPE_PIVOT_TABLE,
Expand Down Expand Up @@ -144,6 +145,7 @@
export const validateLayout = (layout) => {
switch (layout.type) {
case VIS_TYPE_PIE:
case VIS_TYPE_DONUT:
return validatePieLayout(layout)
case VIS_TYPE_YEAR_OVER_YEAR_COLUMN:
case VIS_TYPE_YEAR_OVER_YEAR_LINE:
Expand Down
2 changes: 2 additions & 0 deletions src/modules/options/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
VIS_TYPE_PIVOT_TABLE,
VIS_TYPE_PIE,
VIS_TYPE_GAUGE,
VIS_TYPE_DONUT,

Check failure on line 5 in src/modules/options/config.js

View workflow job for this annotation

GitHub Actions / lint

VIS_TYPE_DONUT not found in '@dhis2/analytics'
VIS_TYPE_SINGLE_VALUE,
VIS_TYPE_SCATTER,
VIS_TYPE_OUTLIER_TABLE,
Expand Down Expand Up @@ -51,6 +52,7 @@
case VIS_TYPE_GAUGE:
return gaugeConfig()
case VIS_TYPE_PIE:
case VIS_TYPE_DONUT:
return pieConfig()
case VIS_TYPE_SINGLE_VALUE:
return singleValueConfig()
Expand Down
5 changes: 5 additions & 0 deletions src/modules/visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
VIS_TYPE_AREA,
VIS_TYPE_STACKED_AREA,
VIS_TYPE_PIE,
VIS_TYPE_DONUT,

Check failure on line 11 in src/modules/visualization.js

View workflow job for this annotation

GitHub Actions / lint

VIS_TYPE_DONUT not found in '@dhis2/analytics'
VIS_TYPE_RADAR,
VIS_TYPE_GAUGE,
VIS_TYPE_YEAR_OVER_YEAR_LINE,
Expand All @@ -32,6 +33,7 @@
VIS_TYPE_AREA,
VIS_TYPE_STACKED_AREA,
VIS_TYPE_PIE,
VIS_TYPE_DONUT,
VIS_TYPE_RADAR,
VIS_TYPE_GAUGE,
VIS_TYPE_YEAR_OVER_YEAR_LINE,
Expand Down Expand Up @@ -69,6 +71,9 @@
[VIS_TYPE_PIE]: i18n.t(
'Compare parts of a whole at a single point in time. Recommend period as filter.'
),
[VIS_TYPE_DONUT]: i18n.t(
'Pie with a hole :-)'
),
[VIS_TYPE_RADAR]: i18n.t(
'Compare several items against multiple variables.'
),
Expand Down
3 changes: 3 additions & 0 deletions src/reducers/current.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
VIS_TYPE_YEAR_OVER_YEAR_LINE,
VIS_TYPE_YEAR_OVER_YEAR_COLUMN,
VIS_TYPE_PIE,
VIS_TYPE_DONUT,

Check failure on line 5 in src/reducers/current.js

View workflow job for this annotation

GitHub Actions / lint

VIS_TYPE_DONUT not found in '@dhis2/analytics'
VIS_TYPE_GAUGE,
VIS_TYPE_OUTLIER_TABLE,
VIS_TYPE_SINGLE_VALUE,
Expand Down Expand Up @@ -53,6 +54,7 @@
case SET_CURRENT_FROM_UI: {
switch (action.value.ui.type) {
case VIS_TYPE_PIE:
case VIS_TYPE_DONUT:
return getPieCurrentFromUi(state, action.value.ui)
case VIS_TYPE_SINGLE_VALUE:
case VIS_TYPE_GAUGE:
Expand Down Expand Up @@ -92,6 +94,7 @@

switch (ui.type) {
case VIS_TYPE_PIE:
case VIS_TYPE_DONUT:
return getPieCurrentFromUi(state, ui)
case VIS_TYPE_SINGLE_VALUE:
case VIS_TYPE_GAUGE:
Expand Down
Loading