@rio-cloud/uikit-mcp 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -39
- package/dist/doc-metadata.json +1872 -0
- package/dist/docs/components/accentBar.md +582 -0
- package/dist/docs/components/activity.md +330 -0
- package/dist/docs/components/animatedNumber.md +88 -0
- package/dist/docs/components/animatedTextReveal.md +381 -0
- package/dist/docs/components/animations.md +459 -0
- package/dist/docs/components/appHeader.md +737 -0
- package/dist/docs/components/appLayout.md +2033 -0
- package/dist/docs/components/appNavigationBar.md +274 -0
- package/dist/docs/components/areaCharts.md +828 -0
- package/dist/docs/components/aspectRatioPlaceholder.md +106 -0
- package/dist/docs/components/assetTree.md +3132 -0
- package/dist/docs/components/autosuggests.md +1177 -0
- package/dist/docs/components/avatar.md +206 -0
- package/dist/docs/components/banner.md +668 -0
- package/dist/docs/components/barCharts.md +2765 -0
- package/dist/docs/components/barList.md +517 -0
- package/dist/docs/components/basicMap.md +167 -0
- package/dist/docs/components/bottomSheet.md +721 -0
- package/dist/docs/components/button.md +775 -0
- package/dist/docs/components/buttonToolbar.md +134 -0
- package/dist/docs/components/calendarStripe.md +533 -0
- package/dist/docs/components/card.md +86 -0
- package/dist/docs/components/carousel.md +128 -0
- package/dist/docs/components/chartColors.md +716 -0
- package/dist/docs/components/chartsGettingStarted.md +28 -0
- package/dist/docs/components/chat.md +935 -0
- package/dist/docs/components/checkbox.md +996 -0
- package/dist/docs/components/clearableInput.md +806 -0
- package/dist/docs/components/collapse.md +189 -0
- package/dist/docs/components/composedCharts.md +424 -0
- package/dist/docs/components/contentLoader.md +674 -0
- package/dist/docs/components/dataTabs.md +1251 -0
- package/dist/docs/components/datepickers.md +2543 -0
- package/dist/docs/components/dialogs.md +2244 -0
- package/dist/docs/components/divider.md +219 -0
- package/dist/docs/components/dropdowns.md +17538 -0
- package/dist/docs/components/editableContent.md +1127 -0
- package/dist/docs/components/expander.md +970 -0
- package/dist/docs/components/fade.md +836 -0
- package/dist/docs/components/fadeExpander.md +180 -0
- package/dist/docs/components/fadeUp.md +396 -0
- package/dist/docs/components/feedback.md +758 -0
- package/dist/docs/components/filePickers.md +370 -0
- package/dist/docs/components/formLabel.md +251 -0
- package/dist/docs/components/fullscreenMap.md +10 -0
- package/dist/docs/components/groupedItemList.md +1001 -0
- package/dist/docs/components/iconList.md +306 -0
- package/dist/docs/components/imagePreloader.md +167 -0
- package/dist/docs/components/labeledElement.md +115 -0
- package/dist/docs/components/licensePlate.md +412 -0
- package/dist/docs/components/lineCharts.md +2014 -0
- package/dist/docs/components/listMenu.md +392 -0
- package/dist/docs/components/loadMore.md +219 -0
- package/dist/docs/components/mainNavigation.md +129 -0
- package/dist/docs/components/mapCircle.md +93 -0
- package/dist/docs/components/mapCluster.md +337 -0
- package/dist/docs/components/mapContext.md +284 -0
- package/dist/docs/components/mapDraggableMarker.md +150 -0
- package/dist/docs/components/mapGettingStarted.md +39 -0
- package/dist/docs/components/mapInfoBubble.md +135 -0
- package/dist/docs/components/mapLayerGroup.md +94 -0
- package/dist/docs/components/mapMarker.md +1814 -0
- package/dist/docs/components/mapPolygon.md +959 -0
- package/dist/docs/components/mapRoute.md +3816 -0
- package/dist/docs/components/mapRouteGenerator.md +6 -0
- package/dist/docs/components/mapSettings.md +1040 -0
- package/dist/docs/components/mapUtils.md +132 -0
- package/dist/docs/components/multiselects.md +1921 -0
- package/dist/docs/components/noData.md +210 -0
- package/dist/docs/components/notifications.md +314 -0
- package/dist/docs/components/numbercontrol.md +706 -0
- package/dist/docs/components/onboarding.md +297 -0
- package/dist/docs/components/page.md +241 -0
- package/dist/docs/components/pager.md +133 -0
- package/dist/docs/components/pieCharts.md +1284 -0
- package/dist/docs/components/popover.md +222 -0
- package/dist/docs/components/position.md +50 -0
- package/dist/docs/components/radialBarCharts.md +3663 -0
- package/dist/docs/components/radiobutton.md +1271 -0
- package/dist/docs/components/releaseNotes.md +135 -0
- package/dist/docs/components/resizer.md +162 -0
- package/dist/docs/components/responsiveColumnStripe.md +435 -0
- package/dist/docs/components/responsiveVideo.md +71 -0
- package/dist/docs/components/rioglyph.md +331 -0
- package/dist/docs/components/rules.md +965 -0
- package/dist/docs/components/saveableInput.md +1721 -0
- package/dist/docs/components/selects.md +1993 -0
- package/dist/docs/components/sidebar.md +332 -0
- package/dist/docs/components/sliders.md +376 -0
- package/dist/docs/components/smoothScrollbars.md +1180 -0
- package/dist/docs/components/spinners.md +506 -0
- package/dist/docs/components/states.md +1176 -0
- package/dist/docs/components/statsWidgets.md +636 -0
- package/dist/docs/components/statusBar.md +644 -0
- package/dist/docs/components/stepButton.md +61 -0
- package/dist/docs/components/steppedProgressBars.md +1064 -0
- package/dist/docs/components/subNavigation.md +470 -0
- package/dist/docs/components/supportMarker.md +115 -0
- package/dist/docs/components/svgImage.md +248 -0
- package/dist/docs/components/switch.md +554 -0
- package/dist/docs/components/tables.md +8 -0
- package/dist/docs/components/tagManager.md +476 -0
- package/dist/docs/components/tags.md +785 -0
- package/dist/docs/components/teaser.md +925 -0
- package/dist/docs/components/timeline.md +514 -0
- package/dist/docs/components/timepicker.md +262 -0
- package/dist/docs/components/toggleButton.md +178 -0
- package/dist/docs/components/tooltip.md +454 -0
- package/dist/docs/components/virtualList.md +486 -0
- package/dist/docs/foundations.md +20901 -0
- package/dist/docs/start/changelog.md +714 -0
- package/dist/docs/start/goodtoknow.md +14 -0
- package/dist/docs/start/guidelines/color-combinations.md +678 -0
- package/dist/docs/start/guidelines/custom-css.md +42 -0
- package/dist/docs/start/guidelines/custom-rioglyph.md +35 -0
- package/dist/docs/start/guidelines/formatting.md +587 -0
- package/dist/docs/start/guidelines/iframe.md +323 -0
- package/dist/docs/start/guidelines/obfuscate-data.md +30 -0
- package/dist/docs/start/guidelines/print-css.md +36 -0
- package/dist/docs/start/guidelines/spinner.md +710 -0
- package/dist/docs/start/guidelines/supported-browsers.md +10 -0
- package/dist/docs/start/guidelines/writing.md +635 -0
- package/dist/docs/start/howto.md +187 -0
- package/dist/docs/start/intro.md +43 -0
- package/dist/docs/start/responsiveness.md +98 -0
- package/dist/docs/templates/common-table.md +1111 -0
- package/dist/docs/templates/detail-views.md +942 -0
- package/dist/docs/templates/expandable-details.md +228 -0
- package/dist/docs/templates/feature-cards.md +549 -0
- package/dist/docs/templates/form-summary.md +199 -0
- package/dist/docs/templates/form-toggle.md +367 -0
- package/dist/docs/templates/list-blocks.md +1021 -0
- package/dist/docs/templates/loading-progress.md +109 -0
- package/dist/docs/templates/options-panel.md +152 -0
- package/dist/docs/templates/panel-variants.md +164 -0
- package/dist/docs/templates/progress-cards.md +607 -0
- package/dist/docs/templates/progress-success.md +142 -0
- package/dist/docs/templates/settings-form.md +434 -0
- package/dist/docs/templates/stats-blocks.md +1381 -0
- package/dist/docs/templates/table-panel.md +184 -0
- package/dist/docs/templates/table-row-animation.md +317 -0
- package/dist/docs/templates/usage-cards.md +227 -0
- package/dist/docs/utilities/deviceUtils.md +123 -0
- package/dist/docs/utilities/featureToggles.md +90 -0
- package/dist/docs/utilities/fuelTypeUtils.md +186 -0
- package/dist/docs/utilities/routeUtils.md +138 -0
- package/dist/docs/utilities/useAfterMount.md +66 -0
- package/dist/docs/utilities/useAutoAnimate.md +193 -0
- package/dist/docs/utilities/useAverage.md +95 -0
- package/dist/docs/utilities/useClickOutside.md +61 -0
- package/dist/docs/utilities/useClipboard.md +93 -0
- package/dist/docs/utilities/useCount.md +178 -0
- package/dist/docs/utilities/useDarkMode.md +49 -0
- package/dist/docs/utilities/useDebugInfo.md +126 -0
- package/dist/docs/utilities/useEffectOnce.md +58 -0
- package/dist/docs/utilities/useElapsedTime.md +58 -0
- package/dist/docs/utilities/useElementSize.md +71 -0
- package/dist/docs/utilities/useEsc.md +58 -0
- package/dist/docs/utilities/useEvent.md +64 -0
- package/dist/docs/utilities/useFocusTrap.md +85 -0
- package/dist/docs/utilities/useFullscreen.md +198 -0
- package/dist/docs/utilities/useHover.md +55 -0
- package/dist/docs/utilities/useIncomingPostMessages.md +237 -0
- package/dist/docs/utilities/useInterval.md +85 -0
- package/dist/docs/utilities/useIsFocusWithin.md +114 -0
- package/dist/docs/utilities/useKey.md +151 -0
- package/dist/docs/utilities/useLocalStorage.md +91 -0
- package/dist/docs/utilities/useLocationSuggestions.md +114 -0
- package/dist/docs/utilities/useMax.md +62 -0
- package/dist/docs/utilities/useMin.md +78 -0
- package/dist/docs/utilities/useMutationObserver.md +113 -0
- package/dist/docs/utilities/useOnScreen.md +138 -0
- package/dist/docs/utilities/useOnlineStatus.md +49 -0
- package/dist/docs/utilities/usePostMessage.md +117 -0
- package/dist/docs/utilities/usePostMessageSender.md +257 -0
- package/dist/docs/utilities/usePrevious.md +101 -0
- package/dist/docs/utilities/useResizeObserver.md +151 -0
- package/dist/docs/utilities/useScrollPosition.md +252 -0
- package/dist/docs/utilities/useSearch.md +228 -0
- package/dist/docs/utilities/useSorting.md +389 -0
- package/dist/docs/utilities/useStateWithValidation.md +83 -0
- package/dist/docs/utilities/useSum.md +155 -0
- package/dist/docs/utilities/useTableExport.md +404 -0
- package/dist/docs/utilities/useTableSelection.md +1120 -0
- package/dist/docs/utilities/useTimeout.md +55 -0
- package/dist/docs/utilities/useToggle.md +115 -0
- package/dist/docs/utilities/useWindowResize.md +70 -0
- package/dist/index.mjs +271 -0
- package/dist/search-synonyms.json +134 -0
- package/dist/version.json +4 -0
- package/package.json +23 -19
- package/bin/uikit-mcp.mjs +0 -23
- package/data/pages/Components/components/accentbar.json +0 -207
- package/data/pages/Components/components/activity.json +0 -87
- package/data/pages/Components/components/animatednumber.json +0 -99
- package/data/pages/Components/components/animations.json +0 -87
- package/data/pages/Components/components/appheader.json +0 -291
- package/data/pages/Components/components/applayout.json +0 -1198
- package/data/pages/Components/components/appnavigationbar.json +0 -327
- package/data/pages/Components/components/areacharts.json +0 -563
- package/data/pages/Components/components/aspectratioplaceholder.json +0 -75
- package/data/pages/Components/components/assettree.json +0 -3080
- package/data/pages/Components/components/autosuggests.json +0 -710
- package/data/pages/Components/components/avatar.json +0 -157
- package/data/pages/Components/components/banner.json +0 -599
- package/data/pages/Components/components/barcharts.json +0 -1507
- package/data/pages/Components/components/barlist.json +0 -223
- package/data/pages/Components/components/basicmap.json +0 -68
- package/data/pages/Components/components/bottomsheet.json +0 -601
- package/data/pages/Components/components/button.json +0 -583
- package/data/pages/Components/components/buttontoolbar.json +0 -63
- package/data/pages/Components/components/calendarstripe.json +0 -235
- package/data/pages/Components/components/card.json +0 -69
- package/data/pages/Components/components/carousel.json +0 -39
- package/data/pages/Components/components/chartcolors.json +0 -34
- package/data/pages/Components/components/chartsgettingstarted.json +0 -32
- package/data/pages/Components/components/chat.json +0 -39
- package/data/pages/Components/components/checkbox.json +0 -847
- package/data/pages/Components/components/clearableinput.json +0 -789
- package/data/pages/Components/components/collapse.json +0 -175
- package/data/pages/Components/components/composedcharts.json +0 -159
- package/data/pages/Components/components/contentloader.json +0 -233
- package/data/pages/Components/components/datatabs.json +0 -680
- package/data/pages/Components/components/datepickers.json +0 -287
- package/data/pages/Components/components/dialogs.json +0 -1492
- package/data/pages/Components/components/divider.json +0 -93
- package/data/pages/Components/components/dropdowns.json +0 -936
- package/data/pages/Components/components/editablecontent.json +0 -1117
- package/data/pages/Components/components/expander.json +0 -377
- package/data/pages/Components/components/fade.json +0 -403
- package/data/pages/Components/components/fadeexpander.json +0 -75
- package/data/pages/Components/components/fadeup.json +0 -127
- package/data/pages/Components/components/feedback.json +0 -269
- package/data/pages/Components/components/filepickers.json +0 -269
- package/data/pages/Components/components/formlabel.json +0 -115
- package/data/pages/Components/components/fullscreenmap.json +0 -22
- package/data/pages/Components/components/groupeditemlist.json +0 -323
- package/data/pages/Components/components/iconlist.json +0 -45
- package/data/pages/Components/components/imagepreloader.json +0 -81
- package/data/pages/Components/components/labeledelement.json +0 -75
- package/data/pages/Components/components/licenseplate.json +0 -69
- package/data/pages/Components/components/linecharts.json +0 -987
- package/data/pages/Components/components/listmenu.json +0 -313
- package/data/pages/Components/components/loadmore.json +0 -175
- package/data/pages/Components/components/mainnavigation.json +0 -39
- package/data/pages/Components/components/mapcircle.json +0 -34
- package/data/pages/Components/components/mapcluster.json +0 -51
- package/data/pages/Components/components/mapcontext.json +0 -105
- package/data/pages/Components/components/mapdraggablemarker.json +0 -34
- package/data/pages/Components/components/mapgettingstarted.json +0 -27
- package/data/pages/Components/components/mapgroup.json +0 -1198
- package/data/pages/Components/components/mapinfobubble.json +0 -34
- package/data/pages/Components/components/maplayergroup.json +0 -34
- package/data/pages/Components/components/mapmarker.json +0 -700
- package/data/pages/Components/components/mappolygon.json +0 -45
- package/data/pages/Components/components/maproute.json +0 -623
- package/data/pages/Components/components/maproutegenerator.json +0 -16
- package/data/pages/Components/components/mapsettings.json +0 -51
- package/data/pages/Components/components/maputils.json +0 -34
- package/data/pages/Components/components/multiselects.json +0 -1451
- package/data/pages/Components/components/nodata.json +0 -139
- package/data/pages/Components/components/notifications.json +0 -65
- package/data/pages/Components/components/numbercontrol.json +0 -301
- package/data/pages/Components/components/onboarding.json +0 -302
- package/data/pages/Components/components/page.json +0 -197
- package/data/pages/Components/components/pager.json +0 -93
- package/data/pages/Components/components/piecharts.json +0 -731
- package/data/pages/Components/components/popover.json +0 -251
- package/data/pages/Components/components/position.json +0 -69
- package/data/pages/Components/components/radialbarcharts.json +0 -1304
- package/data/pages/Components/components/radiobutton.json +0 -1105
- package/data/pages/Components/components/releasenotes.json +0 -44
- package/data/pages/Components/components/resizer.json +0 -93
- package/data/pages/Components/components/responsivecolumnstripe.json +0 -123
- package/data/pages/Components/components/responsivevideo.json +0 -75
- package/data/pages/Components/components/rioglyph.json +0 -93
- package/data/pages/Components/components/rules.json +0 -410
- package/data/pages/Components/components/saveableinput.json +0 -703
- package/data/pages/Components/components/selects.json +0 -701
- package/data/pages/Components/components/sidebar.json +0 -243
- package/data/pages/Components/components/sliders.json +0 -235
- package/data/pages/Components/components/smoothscrollbars.json +0 -335
- package/data/pages/Components/components/spinners.json +0 -343
- package/data/pages/Components/components/states.json +0 -1705
- package/data/pages/Components/components/statswidgets.json +0 -314
- package/data/pages/Components/components/statusbar.json +0 -177
- package/data/pages/Components/components/stepbutton.json +0 -57
- package/data/pages/Components/components/steppedprogressbars.json +0 -417
- package/data/pages/Components/components/subnavigation.json +0 -107
- package/data/pages/Components/components/supportmarker.json +0 -45
- package/data/pages/Components/components/svgimage.json +0 -81
- package/data/pages/Components/components/switch.json +0 -111
- package/data/pages/Components/components/tables.json +0 -144
- package/data/pages/Components/components/tagmanager.json +0 -86
- package/data/pages/Components/components/tags.json +0 -146
- package/data/pages/Components/components/teaser.json +0 -188
- package/data/pages/Components/components/timeline.json +0 -45
- package/data/pages/Components/components/timepicker.json +0 -163
- package/data/pages/Components/components/togglebutton.json +0 -247
- package/data/pages/Components/components/tooltip.json +0 -270
- package/data/pages/Components/components/virtuallist.json +0 -175
- package/data/pages/Foundations/foundations.json +0 -2475
- package/data/pages/Getting-started/start/changelog.json +0 -22
- package/data/pages/Getting-started/start/goodtoknow.json +0 -32
- package/data/pages/Getting-started/start/guidelines/color-combinations.json +0 -58
- package/data/pages/Getting-started/start/guidelines/custom-css.json +0 -27
- package/data/pages/Getting-started/start/guidelines/custom-rioglyph.json +0 -22
- package/data/pages/Getting-started/start/guidelines/formatting.json +0 -97
- package/data/pages/Getting-started/start/guidelines/iframe.json +0 -93
- package/data/pages/Getting-started/start/guidelines/obfuscate-data.json +0 -22
- package/data/pages/Getting-started/start/guidelines/print-css.json +0 -37
- package/data/pages/Getting-started/start/guidelines/spinner.json +0 -144
- package/data/pages/Getting-started/start/guidelines/supported-browsers.json +0 -22
- package/data/pages/Getting-started/start/guidelines/writing.json +0 -242
- package/data/pages/Getting-started/start/howto.json +0 -72
- package/data/pages/Getting-started/start/intro.json +0 -37
- package/data/pages/Getting-started/start/responsiveness.json +0 -52
- package/data/pages/Templates/templates/common-table.json +0 -39
- package/data/pages/Templates/templates/detail-views.json +0 -71
- package/data/pages/Templates/templates/expandable-details.json +0 -39
- package/data/pages/Templates/templates/feature-cards.json +0 -103
- package/data/pages/Templates/templates/form-summary.json +0 -39
- package/data/pages/Templates/templates/form-toggle.json +0 -39
- package/data/pages/Templates/templates/list-blocks.json +0 -119
- package/data/pages/Templates/templates/loading-progress.json +0 -39
- package/data/pages/Templates/templates/options-panel.json +0 -39
- package/data/pages/Templates/templates/panel-variants.json +0 -39
- package/data/pages/Templates/templates/progress-cards.json +0 -71
- package/data/pages/Templates/templates/progress-success.json +0 -39
- package/data/pages/Templates/templates/settings-form.json +0 -39
- package/data/pages/Templates/templates/stats-blocks.json +0 -135
- package/data/pages/Templates/templates/table-panel.json +0 -39
- package/data/pages/Templates/templates/table-row-animation.json +0 -39
- package/data/pages/Templates/templates/usage-cards.json +0 -39
- package/data/pages/Utilities/utilities/deviceutils.json +0 -39
- package/data/pages/Utilities/utilities/featuretoggles.json +0 -42
- package/data/pages/Utilities/utilities/fueltypeutils.json +0 -118
- package/data/pages/Utilities/utilities/routeutils.json +0 -34
- package/data/pages/Utilities/utilities/useaftermount.json +0 -63
- package/data/pages/Utilities/utilities/useaverage.json +0 -86
- package/data/pages/Utilities/utilities/useclickoutside.json +0 -69
- package/data/pages/Utilities/utilities/useclipboard.json +0 -57
- package/data/pages/Utilities/utilities/usecount.json +0 -92
- package/data/pages/Utilities/utilities/usedarkmode.json +0 -50
- package/data/pages/Utilities/utilities/usedebuginfo.json +0 -63
- package/data/pages/Utilities/utilities/useeffectonce.json +0 -57
- package/data/pages/Utilities/utilities/useelapsedtime.json +0 -57
- package/data/pages/Utilities/utilities/useelementsize.json +0 -63
- package/data/pages/Utilities/utilities/useesc.json +0 -57
- package/data/pages/Utilities/utilities/useevent.json +0 -75
- package/data/pages/Utilities/utilities/usefocustrap.json +0 -57
- package/data/pages/Utilities/utilities/usefullscreen.json +0 -197
- package/data/pages/Utilities/utilities/usehover.json +0 -57
- package/data/pages/Utilities/utilities/useinterval.json +0 -63
- package/data/pages/Utilities/utilities/useisfocuswithin.json +0 -75
- package/data/pages/Utilities/utilities/usekey.json +0 -75
- package/data/pages/Utilities/utilities/uselocalstorage.json +0 -69
- package/data/pages/Utilities/utilities/uselocationsuggestions.json +0 -110
- package/data/pages/Utilities/utilities/usemax.json +0 -86
- package/data/pages/Utilities/utilities/usemin.json +0 -86
- package/data/pages/Utilities/utilities/usemutationobserver.json +0 -69
- package/data/pages/Utilities/utilities/useonlinestatus.json +0 -39
- package/data/pages/Utilities/utilities/useonscreen.json +0 -63
- package/data/pages/Utilities/utilities/usepostmessage.json +0 -80
- package/data/pages/Utilities/utilities/useprevious.json +0 -63
- package/data/pages/Utilities/utilities/useresizeobserver.json +0 -65
- package/data/pages/Utilities/utilities/usescrollposition.json +0 -103
- package/data/pages/Utilities/utilities/usesearch.json +0 -197
- package/data/pages/Utilities/utilities/usesorting.json +0 -139
- package/data/pages/Utilities/utilities/usestatewithvalidation.json +0 -69
- package/data/pages/Utilities/utilities/usesum.json +0 -86
- package/data/pages/Utilities/utilities/usetableexport.json +0 -87
- package/data/pages/Utilities/utilities/usetableselection.json +0 -311
- package/data/pages/Utilities/utilities/usetimeout.json +0 -63
- package/data/pages/Utilities/utilities/usetoggle.json +0 -75
- package/data/pages/Utilities/utilities/usewindowresize.json +0 -63
- package/data/version.json +0 -4
- package/docs/content-schema.md +0 -147
- package/docs/navigation-inventory.json +0 -1310
- package/docs/search-synonyms.json +0 -43
- package/server/index.mjs +0 -268
- package/server/lib/load-docs.mjs +0 -48
- package/server/lib/normalise-doc.mjs +0 -220
- package/server/lib/render-markdown.mjs +0 -82
- package/server/lib/search-index.mjs +0 -49
- package/server/lib/types.js +0 -99
|
@@ -0,0 +1,1284 @@
|
|
|
1
|
+
# PieChart
|
|
2
|
+
|
|
3
|
+
*Category:* Components
|
|
4
|
+
*Section:* Charts
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#components/pieCharts
|
|
6
|
+
*Captured:* 2025-12-12T14:21:27.599Z
|
|
7
|
+
|
|
8
|
+
## PieChart
|
|
9
|
+
|
|
10
|
+
> Note: When using a chart in your application, do not get fancy and try to stick to the proposed examples or at least base your chart upon them. That will save time and money and, equally important, gives the user a coherent look and feel across the different services.
|
|
11
|
+
|
|
12
|
+
### Example: Example 1
|
|
13
|
+
|
|
14
|
+
Simple PieChartBasistarif
|
|
15
|
+
Diesel
|
|
16
|
+
Maut
|
|
17
|
+
Zuschläge
|
|
18
|
+
|
|
19
|
+
#### Summary
|
|
20
|
+
|
|
21
|
+
Simple PieChartBasistarif
|
|
22
|
+
Diesel
|
|
23
|
+
Maut
|
|
24
|
+
Zuschläge
|
|
25
|
+
|
|
26
|
+
#### React (tsx)
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import PieChart from '@rio-cloud/rio-uikit/PieChart';
|
|
30
|
+
|
|
31
|
+
type CustomData = {
|
|
32
|
+
name: string;
|
|
33
|
+
costs: number;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default () => {
|
|
37
|
+
return (
|
|
38
|
+
<>
|
|
39
|
+
<label>Simple PieChart</label>
|
|
40
|
+
<div className='panel panel-default panel-body margin-bottom-0 width-100% height-500'>
|
|
41
|
+
<PieChart data={data} dataKey='costs' dataUnit='€' filled />
|
|
42
|
+
</div>
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const data: CustomData[] = [
|
|
48
|
+
{
|
|
49
|
+
name: 'Basistarif',
|
|
50
|
+
costs: 46.8,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Diesel',
|
|
54
|
+
costs: 22.0,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Maut',
|
|
58
|
+
costs: 12.4,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Zuschläge',
|
|
62
|
+
costs: 3.88,
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### HTML (html)
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<label>Simple PieChart</label>
|
|
71
|
+
<div class="panel panel-default panel-body margin-bottom-0 width-100% height-500">
|
|
72
|
+
<div class="recharts-responsive-container" style="width: 100%; height: 100%; min-width: 100px; min-height: 100px;">
|
|
73
|
+
<div style="width: 0px; height: 0px; overflow: visible;">
|
|
74
|
+
<div width="876" height="468" class="recharts-wrapper" style="position: relative; cursor: default; width: 876px; height: 468px;">
|
|
75
|
+
<div class="recharts-legend-wrapper" style="position: absolute; width: auto; height: auto; right: 5px; top: 5px;">
|
|
76
|
+
<ul class="recharts-default-legend" style="padding: 0px; margin: 0px; text-align: left;">
|
|
77
|
+
<li class="recharts-legend-item legend-item-0" style="display: block; margin-right: 10px;">
|
|
78
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
79
|
+
<title>
|
|
80
|
+
</title>
|
|
81
|
+
<desc>
|
|
82
|
+
</desc>
|
|
83
|
+
<path fill="#ef7186 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
84
|
+
</path>
|
|
85
|
+
</svg>
|
|
86
|
+
<span class="recharts-legend-item-text" style="color: rgb(239, 113, 134);">
|
|
87
|
+
<span class="text-color-darker">Basistarif</span>
|
|
88
|
+
</span>
|
|
89
|
+
</li>
|
|
90
|
+
<li class="recharts-legend-item legend-item-1" style="display: block; margin-right: 10px;">
|
|
91
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
92
|
+
<title>
|
|
93
|
+
</title>
|
|
94
|
+
<desc>
|
|
95
|
+
</desc>
|
|
96
|
+
<path fill="#e878b6 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
97
|
+
</path>
|
|
98
|
+
</svg>
|
|
99
|
+
<span class="recharts-legend-item-text" style="color: rgb(232, 120, 182);">
|
|
100
|
+
<span class="text-color-darker">Diesel</span>
|
|
101
|
+
</span>
|
|
102
|
+
</li>
|
|
103
|
+
<li class="recharts-legend-item legend-item-2" style="display: block; margin-right: 10px;">
|
|
104
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
105
|
+
<title>
|
|
106
|
+
</title>
|
|
107
|
+
<desc>
|
|
108
|
+
</desc>
|
|
109
|
+
<path fill="#dc82e9 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
110
|
+
</path>
|
|
111
|
+
</svg>
|
|
112
|
+
<span class="recharts-legend-item-text" style="color: rgb(220, 130, 233);">
|
|
113
|
+
<span class="text-color-darker">Maut</span>
|
|
114
|
+
</span>
|
|
115
|
+
</li>
|
|
116
|
+
<li class="recharts-legend-item legend-item-3" style="display: block; margin-right: 10px;">
|
|
117
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
118
|
+
<title>
|
|
119
|
+
</title>
|
|
120
|
+
<desc>
|
|
121
|
+
</desc>
|
|
122
|
+
<path fill="#c08eeb " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
123
|
+
</path>
|
|
124
|
+
</svg>
|
|
125
|
+
<span class="recharts-legend-item-text" style="color: rgb(192, 142, 235);">
|
|
126
|
+
<span class="text-color-darker">Zuschläge</span>
|
|
127
|
+
</span>
|
|
128
|
+
</li>
|
|
129
|
+
</ul>
|
|
130
|
+
</div>
|
|
131
|
+
<div xmlns="http://www.w3.org/1999/xhtml" tabindex="-1" class="recharts-tooltip-wrapper" style="visibility: hidden; pointer-events: none; position: absolute; top: 0px; left: 0px;">
|
|
132
|
+
<div class="recharts-default-tooltip" role="status" aria-live="assertive" style="margin: 0px; padding: 10px; background-color: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204); white-space: nowrap;">
|
|
133
|
+
<p class="recharts-tooltip-label" style="margin: 0px;">
|
|
134
|
+
</p>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
<svg cx="50%" cy="50%" role="application" tabindex="0" class="recharts-surface" width="876" height="468" viewBox="0 0 876 468" style="width: 100%; height: 100%; display: block;">
|
|
138
|
+
<title>
|
|
139
|
+
</title>
|
|
140
|
+
<desc>
|
|
141
|
+
</desc>
|
|
142
|
+
<g tabindex="-1" id="recharts-zindex--100-:r1:">
|
|
143
|
+
</g>
|
|
144
|
+
<g tabindex="-1" id="recharts-zindex--50-:r2:">
|
|
145
|
+
</g>
|
|
146
|
+
<defs>
|
|
147
|
+
<clipPath id="recharts1-clip">
|
|
148
|
+
<rect x="5" y="5" height="458" width="780.859375">
|
|
149
|
+
</rect>
|
|
150
|
+
</clipPath>
|
|
151
|
+
</defs>
|
|
152
|
+
<g tabindex="-1" id="recharts-zindex-100-:r4:">
|
|
153
|
+
<g class="recharts-layer recharts-pie" tabindex="0">
|
|
154
|
+
<g class="recharts-layer">
|
|
155
|
+
</g>
|
|
156
|
+
</g>
|
|
157
|
+
</g>
|
|
158
|
+
<g tabindex="-1" id="recharts-zindex-200-:r5:">
|
|
159
|
+
</g>
|
|
160
|
+
<g tabindex="-1" id="recharts-zindex-300-:r6:">
|
|
161
|
+
</g>
|
|
162
|
+
<g tabindex="-1" id="recharts-zindex-400-:r7:">
|
|
163
|
+
</g>
|
|
164
|
+
<g tabindex="-1" id="recharts-zindex-500-:r8:">
|
|
165
|
+
</g>
|
|
166
|
+
<g tabindex="-1" id="recharts-zindex-600-:r9:">
|
|
167
|
+
</g>
|
|
168
|
+
<g tabindex="-1" id="recharts-zindex-1000-:ra:">
|
|
169
|
+
</g>
|
|
170
|
+
<g tabindex="-1" id="recharts-zindex-1100-:rb:">
|
|
171
|
+
</g>
|
|
172
|
+
<g tabindex="-1" id="recharts-zindex-1200-:rc:">
|
|
173
|
+
</g>
|
|
174
|
+
<g tabindex="-1" id="recharts-zindex-2000-:rd:">
|
|
175
|
+
</g>
|
|
176
|
+
</svg>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### Props: PieChart
|
|
184
|
+
|
|
185
|
+
### PieChart
|
|
186
|
+
|
|
187
|
+
| Name | Type | Default | Description |
|
|
188
|
+
| --- | --- | --- | --- |
|
|
189
|
+
| width | Number | — | The width of chart container. |
|
|
190
|
+
| height | Number | — | The height of chart container. |
|
|
191
|
+
| innerRadius | String \| Number | 60 | The inner radius of all the sectors. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. |
|
|
192
|
+
| outerRadius | String \| Number | 80 | The outer radius of all the sectors. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. |
|
|
193
|
+
| data | Array | — | The source data, in which each element is an object. It has the following format: [{ name: "a", value: 12 }] Note: for some charts, the color of the individual data is taken from the color prop: [{ name: "a", value: 12, color: "color-coldplay-fountain" }] |
|
|
194
|
+
| dataKey | string \| number \| ((obj: T) => any) | value | The key of data used for the PieChart. |
|
|
195
|
+
| dataUnit | String \| Number | — | The unit of data displayed in the PieChart. |
|
|
196
|
+
| nameKey | String | name | The key of each sector name. |
|
|
197
|
+
| color | Function | — | Overwrite the way the color is taken from the data input array. Use this, if you had to rename the color prop in your data or if you want to provide the corresponding color in another way. Take the color name from the charts colors page. |
|
|
198
|
+
| filled | Boolean | false | Set to "true" if the chart should be filled. This will set the "innerRadius" and the "paddingAngle" to 0. |
|
|
199
|
+
| labels | Function \| Boolean | true | If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. If set a function, the function will be called to render customized label. |
|
|
200
|
+
| innerLabels | Boolean | false | Set to "true" if the built in inner label shall be used. This makes only sense when labels are enabled, and the chart is filled or the inner radius is set to 0. |
|
|
201
|
+
| paddingAngle | Number | 3 | The angle between two sectors. |
|
|
202
|
+
| pieOptions | Object | — | Detailed options passed to the underlying Pie component. Details can be found here: https://recharts.org/en-US/api/Pie |
|
|
203
|
+
| containerOptions | Object | — | Detailed options passed to the underlying ResponsiveContainer component. Details can be found here: https://recharts.org/en-US/api/ResponsiveContainer |
|
|
204
|
+
| tooltip | ChartTooltip \| Boolean | — | Defines whether or not the tooltip component shall be used. You can customize the tooltip by providing a custom ChartTooltip. Prop details can be found here: https://recharts.org/en-US/api/Tooltip. You can also customize the cursor color by setting a stroke or fill color in the cursor props. Details can be found here: https://recharts.org/en-US/api/Tooltip#cursor |
|
|
205
|
+
| legend | Legend \| Boolean | <Legend /> | Shows the provided Legend component otherwise shows nothing. |
|
|
206
|
+
| ... | | — | Additional props are passed to the underlying PieChart component. Details can be found here: https://recharts.org/en-US/api/PieChart |
|
|
207
|
+
|
|
208
|
+
#### Props: Legend
|
|
209
|
+
|
|
210
|
+
### Legend
|
|
211
|
+
|
|
212
|
+
| Name | Type | Default | Description |
|
|
213
|
+
| --- | --- | --- | --- |
|
|
214
|
+
| iconType | String | square | Defines the type of the leading icon. |
|
|
215
|
+
| iconSize | String | 12 | Defines the size of the leading icon. |
|
|
216
|
+
| layout | String | vertical | Defines the layout of the legend. |
|
|
217
|
+
| align | String | right | Defines the alignment of the legend relative to the chart. |
|
|
218
|
+
| verticalAlign | String | top | Defines the vertical alignment of the legend relative to the chart. |
|
|
219
|
+
| ... | | — | Additional props are passed to the underlying legend component. Details can be found here: https://recharts.org/en-US/api/Legend |
|
|
220
|
+
|
|
221
|
+
### Example: Example 2
|
|
222
|
+
|
|
223
|
+
PieChart with custom colorBasistarif
|
|
224
|
+
Diesel
|
|
225
|
+
Maut
|
|
226
|
+
Zuschläge
|
|
227
|
+
|
|
228
|
+
Filled PieChart with inner labelsBasistarif
|
|
229
|
+
Diesel
|
|
230
|
+
Maut
|
|
231
|
+
|
|
232
|
+
#### Summary
|
|
233
|
+
|
|
234
|
+
PieChart with custom colorBasistarif
|
|
235
|
+
Diesel
|
|
236
|
+
Maut
|
|
237
|
+
Zuschläge
|
|
238
|
+
|
|
239
|
+
Filled PieChart with inner labelsBasistarif
|
|
240
|
+
Diesel
|
|
241
|
+
Maut
|
|
242
|
+
|
|
243
|
+
#### React (tsx)
|
|
244
|
+
|
|
245
|
+
```tsx
|
|
246
|
+
import PieChart from '@rio-cloud/rio-uikit/PieChart';
|
|
247
|
+
|
|
248
|
+
type CustomData = {
|
|
249
|
+
label: string;
|
|
250
|
+
color: string;
|
|
251
|
+
costs: number;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export default () => {
|
|
255
|
+
return (
|
|
256
|
+
<div className='display-flex flex-column flex-row-lg flex-wrap gap-15'>
|
|
257
|
+
<div className='flex-1-1 max-width-500'>
|
|
258
|
+
<label>PieChart with custom color</label>
|
|
259
|
+
<div className='panel panel-default panel-body margin-bottom-0 height-300'>
|
|
260
|
+
<PieChart data={data} dataKey='costs' nameKey='label' dataUnit='%' innerRadius={85} />
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
<div className='flex-1-1 max-width-500'>
|
|
264
|
+
<label>Filled PieChart with inner labels</label>
|
|
265
|
+
<div className='panel panel-default panel-body margin-bottom-0 height-300'>
|
|
266
|
+
<PieChart
|
|
267
|
+
data={data.filter(entry => entry.costs > 10)}
|
|
268
|
+
dataKey='costs'
|
|
269
|
+
dataUnit='%'
|
|
270
|
+
nameKey='label'
|
|
271
|
+
filled
|
|
272
|
+
innerLabels
|
|
273
|
+
color={entry => entry.color}
|
|
274
|
+
/>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
const data: CustomData[] = [
|
|
282
|
+
{
|
|
283
|
+
label: 'Basistarif',
|
|
284
|
+
color: 'color-coldplay-fountain',
|
|
285
|
+
costs: 46.8,
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
label: 'Diesel',
|
|
289
|
+
color: 'color-coldplay-turquoise',
|
|
290
|
+
costs: 22.0,
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
label: 'Maut',
|
|
294
|
+
color: 'color-coldplay-moos',
|
|
295
|
+
costs: 12.4,
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
label: 'Zuschläge',
|
|
299
|
+
color: 'brand-warning',
|
|
300
|
+
costs: 3.88,
|
|
301
|
+
},
|
|
302
|
+
];
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
#### HTML (html)
|
|
306
|
+
|
|
307
|
+
```html
|
|
308
|
+
<div class="display-flex flex-column flex-row-lg flex-wrap gap-15">
|
|
309
|
+
<div class="flex-1-1 max-width-500">
|
|
310
|
+
<label>PieChart with custom color</label>
|
|
311
|
+
<div class="panel panel-default panel-body margin-bottom-0 height-300">
|
|
312
|
+
<div class="recharts-responsive-container" style="width: 100%; height: 100%; min-width: 100px; min-height: 100px;">
|
|
313
|
+
<div style="width: 0px; height: 0px; overflow: visible;">
|
|
314
|
+
<div width="403" height="268" class="recharts-wrapper" style="position: relative; cursor: default; width: 403px; height: 268px;">
|
|
315
|
+
<div class="recharts-legend-wrapper" style="position: absolute; width: auto; height: auto; right: 5px; top: 5px;">
|
|
316
|
+
<ul class="recharts-default-legend" style="padding: 0px; margin: 0px; text-align: left;">
|
|
317
|
+
<li class="recharts-legend-item legend-item-0" style="display: block; margin-right: 10px;">
|
|
318
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
319
|
+
<title>
|
|
320
|
+
</title>
|
|
321
|
+
<desc>
|
|
322
|
+
</desc>
|
|
323
|
+
<path fill="#67abc5 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
324
|
+
</path>
|
|
325
|
+
</svg>
|
|
326
|
+
<span class="recharts-legend-item-text" style="color: rgb(103, 171, 197);">
|
|
327
|
+
<span class="text-color-darker">Basistarif</span>
|
|
328
|
+
</span>
|
|
329
|
+
</li>
|
|
330
|
+
<li class="recharts-legend-item legend-item-1" style="display: block; margin-right: 10px;">
|
|
331
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
332
|
+
<title>
|
|
333
|
+
</title>
|
|
334
|
+
<desc>
|
|
335
|
+
</desc>
|
|
336
|
+
<path fill="#4eccc1 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
337
|
+
</path>
|
|
338
|
+
</svg>
|
|
339
|
+
<span class="recharts-legend-item-text" style="color: rgb(78, 204, 193);">
|
|
340
|
+
<span class="text-color-darker">Diesel</span>
|
|
341
|
+
</span>
|
|
342
|
+
</li>
|
|
343
|
+
<li class="recharts-legend-item legend-item-2" style="display: block; margin-right: 10px;">
|
|
344
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
345
|
+
<title>
|
|
346
|
+
</title>
|
|
347
|
+
<desc>
|
|
348
|
+
</desc>
|
|
349
|
+
<path fill="#a1daa3 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
350
|
+
</path>
|
|
351
|
+
</svg>
|
|
352
|
+
<span class="recharts-legend-item-text" style="color: rgb(161, 218, 163);">
|
|
353
|
+
<span class="text-color-darker">Maut</span>
|
|
354
|
+
</span>
|
|
355
|
+
</li>
|
|
356
|
+
<li class="recharts-legend-item legend-item-3" style="display: block; margin-right: 10px;">
|
|
357
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
358
|
+
<title>
|
|
359
|
+
</title>
|
|
360
|
+
<desc>
|
|
361
|
+
</desc>
|
|
362
|
+
<path fill="#ff8e3c " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
363
|
+
</path>
|
|
364
|
+
</svg>
|
|
365
|
+
<span class="recharts-legend-item-text" style="color: rgb(255, 142, 60);">
|
|
366
|
+
<span class="text-color-darker">Zuschläge</span>
|
|
367
|
+
</span>
|
|
368
|
+
</li>
|
|
369
|
+
</ul>
|
|
370
|
+
</div>
|
|
371
|
+
<div xmlns="http://www.w3.org/1999/xhtml" tabindex="-1" class="recharts-tooltip-wrapper" style="visibility: hidden; pointer-events: none; position: absolute; top: 0px; left: 0px;">
|
|
372
|
+
<div class="recharts-default-tooltip" role="status" aria-live="assertive" style="margin: 0px; padding: 10px; background-color: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204); white-space: nowrap;">
|
|
373
|
+
<p class="recharts-tooltip-label" style="margin: 0px;">
|
|
374
|
+
</p>
|
|
375
|
+
</div>
|
|
376
|
+
</div>
|
|
377
|
+
<svg cx="50%" cy="50%" role="application" tabindex="0" class="recharts-surface" width="403" height="268" viewBox="0 0 403 268" style="width: 100%; height: 100%; display: block;">
|
|
378
|
+
<title>
|
|
379
|
+
</title>
|
|
380
|
+
<desc>
|
|
381
|
+
</desc>
|
|
382
|
+
<g tabindex="-1" id="recharts-zindex--100-:re:">
|
|
383
|
+
</g>
|
|
384
|
+
<g tabindex="-1" id="recharts-zindex--50-:rf:">
|
|
385
|
+
</g>
|
|
386
|
+
<defs>
|
|
387
|
+
<clipPath id="recharts2-clip">
|
|
388
|
+
<rect x="5" y="5" height="258" width="307.859375">
|
|
389
|
+
</rect>
|
|
390
|
+
</clipPath>
|
|
391
|
+
</defs>
|
|
392
|
+
<g tabindex="-1" id="recharts-zindex-100-:rh:">
|
|
393
|
+
<g class="recharts-layer recharts-pie" tabindex="0">
|
|
394
|
+
<g class="recharts-layer">
|
|
395
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
396
|
+
<path cx="158.9296875" cy="134" fill="#67abc5 " stroke="#fff" name="Basistarif" color="color-coldplay-fountain" tabindex="-1" data-recharts-item-index="0" data-recharts-item-data-key="costs" class="recharts-sector" d="M 262.1296875,134
|
|
397
|
+
A 103.2,103.2,0,
|
|
398
|
+
0,0,
|
|
399
|
+
100.68578761471323,48.806760091233215
|
|
400
|
+
L 110.95748313711846,63.83114929994984
|
|
401
|
+
A 85,85,0,
|
|
402
|
+
0,1,
|
|
403
|
+
243.9296875,134 Z">
|
|
404
|
+
</path>
|
|
405
|
+
</g>
|
|
406
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
407
|
+
<path cx="158.9296875" cy="134" fill="#4eccc1 " stroke="#fff" name="Diesel" color="color-coldplay-turquoise" tabindex="-1" data-recharts-item-index="1" data-recharts-item-data-key="costs" class="recharts-sector" d="M 96.30693917920428,51.971764661488194
|
|
408
|
+
A 103.2,103.2,0,
|
|
409
|
+
0,0,
|
|
410
|
+
56.26139106708253,144.46235669257095
|
|
411
|
+
L 74.3676216395544,142.61725115182685
|
|
412
|
+
A 85,85,0,
|
|
413
|
+
0,1,
|
|
414
|
+
107.3508734760888,66.43798445955908 Z">
|
|
415
|
+
</path>
|
|
416
|
+
</g>
|
|
417
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
418
|
+
<path cx="158.9296875" cy="134" fill="#a1daa3 " stroke="#fff" name="Maut" color="color-coldplay-moos" tabindex="-1" data-recharts-item-index="2" data-recharts-item-data-key="costs" class="recharts-sector" d="M 56.94965184121139,149.82126186598927
|
|
419
|
+
A 103.2,103.2,0,
|
|
420
|
+
0,0,
|
|
421
|
+
81.95872893429402,202.74381090306508
|
|
422
|
+
L 95.53306465033907,190.62038688721447
|
|
423
|
+
A 85,85,0,
|
|
424
|
+
0,1,
|
|
425
|
+
74.93450309111404,147.03107808729737 Z">
|
|
426
|
+
</path>
|
|
427
|
+
</g>
|
|
428
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
429
|
+
<path cx="158.9296875" cy="134" fill="#ff8e3c " stroke="#fff" name="Zuschläge" color="brand-warning" tabindex="-1" data-recharts-item-index="3" data-recharts-item-data-key="costs" class="recharts-sector" d="M 85.66198803731146,206.67794861885653
|
|
430
|
+
A 103.2,103.2,0,
|
|
431
|
+
0,0,
|
|
432
|
+
99.85261619613395,218.61760836940456
|
|
433
|
+
L 110.27124698809482,203.69473557557546
|
|
434
|
+
A 85,85,0,
|
|
435
|
+
0,1,
|
|
436
|
+
98.58322960921971,193.86071349421323 Z">
|
|
437
|
+
</path>
|
|
438
|
+
</g>
|
|
439
|
+
</g>
|
|
440
|
+
</g>
|
|
441
|
+
</g>
|
|
442
|
+
<g tabindex="-1" id="recharts-zindex-200-:ri:">
|
|
443
|
+
</g>
|
|
444
|
+
<g tabindex="-1" id="recharts-zindex-300-:rj:">
|
|
445
|
+
</g>
|
|
446
|
+
<g tabindex="-1" id="recharts-zindex-400-:rk:">
|
|
447
|
+
</g>
|
|
448
|
+
<g tabindex="-1" id="recharts-zindex-500-:rl:">
|
|
449
|
+
</g>
|
|
450
|
+
<g tabindex="-1" id="recharts-zindex-600-:rm:">
|
|
451
|
+
</g>
|
|
452
|
+
<g tabindex="-1" id="recharts-zindex-1000-:rn:">
|
|
453
|
+
</g>
|
|
454
|
+
<g tabindex="-1" id="recharts-zindex-1100-:ro:">
|
|
455
|
+
</g>
|
|
456
|
+
<g tabindex="-1" id="recharts-zindex-1200-:rp:">
|
|
457
|
+
</g>
|
|
458
|
+
<g tabindex="-1" id="recharts-zindex-2000-:rq:">
|
|
459
|
+
</g>
|
|
460
|
+
</svg>
|
|
461
|
+
</div>
|
|
462
|
+
</div>
|
|
463
|
+
</div>
|
|
464
|
+
</div>
|
|
465
|
+
</div>
|
|
466
|
+
<div class="flex-1-1 max-width-500">
|
|
467
|
+
<label>Filled PieChart with inner labels</label>
|
|
468
|
+
<div class="panel panel-default panel-body margin-bottom-0 height-300">
|
|
469
|
+
<div class="recharts-responsive-container" style="width: 100%; height: 100%; min-width: 100px; min-height: 100px;">
|
|
470
|
+
<div style="width: 0px; height: 0px; overflow: visible;">
|
|
471
|
+
<div width="426" height="268" class="recharts-wrapper" style="position: relative; cursor: default; width: 426px; height: 268px;">
|
|
472
|
+
<div class="recharts-legend-wrapper" style="position: absolute; width: auto; height: auto; right: 5px; top: 5px;">
|
|
473
|
+
<ul class="recharts-default-legend" style="padding: 0px; margin: 0px; text-align: left;">
|
|
474
|
+
<li class="recharts-legend-item legend-item-0" style="display: block; margin-right: 10px;">
|
|
475
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
476
|
+
<title>
|
|
477
|
+
</title>
|
|
478
|
+
<desc>
|
|
479
|
+
</desc>
|
|
480
|
+
<path fill="#67abc5 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
481
|
+
</path>
|
|
482
|
+
</svg>
|
|
483
|
+
<span class="recharts-legend-item-text" style="color: rgb(103, 171, 197);">
|
|
484
|
+
<span class="text-color-darker">Basistarif</span>
|
|
485
|
+
</span>
|
|
486
|
+
</li>
|
|
487
|
+
<li class="recharts-legend-item legend-item-1" style="display: block; margin-right: 10px;">
|
|
488
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
489
|
+
<title>
|
|
490
|
+
</title>
|
|
491
|
+
<desc>
|
|
492
|
+
</desc>
|
|
493
|
+
<path fill="#4eccc1 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
494
|
+
</path>
|
|
495
|
+
</svg>
|
|
496
|
+
<span class="recharts-legend-item-text" style="color: rgb(78, 204, 193);">
|
|
497
|
+
<span class="text-color-darker">Diesel</span>
|
|
498
|
+
</span>
|
|
499
|
+
</li>
|
|
500
|
+
<li class="recharts-legend-item legend-item-2" style="display: block; margin-right: 10px;">
|
|
501
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="12" height="12" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
502
|
+
<title>
|
|
503
|
+
</title>
|
|
504
|
+
<desc>
|
|
505
|
+
</desc>
|
|
506
|
+
<path fill="#a1daa3 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M16,0A16,16,0,1,1,-16,0A16,16,0,1,1,16,0">
|
|
507
|
+
</path>
|
|
508
|
+
</svg>
|
|
509
|
+
<span class="recharts-legend-item-text" style="color: rgb(161, 218, 163);">
|
|
510
|
+
<span class="text-color-darker">Maut</span>
|
|
511
|
+
</span>
|
|
512
|
+
</li>
|
|
513
|
+
</ul>
|
|
514
|
+
</div>
|
|
515
|
+
<div xmlns="http://www.w3.org/1999/xhtml" tabindex="-1" class="recharts-tooltip-wrapper" style="visibility: hidden; pointer-events: none; position: absolute; top: 0px; left: 0px;">
|
|
516
|
+
<div class="recharts-default-tooltip" role="status" aria-live="assertive" style="margin: 0px; padding: 10px; background-color: rgb(255, 255, 255); border: 1px solid rgb(204, 204, 204); white-space: nowrap;">
|
|
517
|
+
<p class="recharts-tooltip-label" style="margin: 0px;">
|
|
518
|
+
</p>
|
|
519
|
+
</div>
|
|
520
|
+
</div>
|
|
521
|
+
<svg cx="50%" cy="50%" role="application" tabindex="0" class="recharts-surface" width="426" height="268" viewBox="0 0 426 268" style="width: 100%; height: 100%; display: block;">
|
|
522
|
+
<title>
|
|
523
|
+
</title>
|
|
524
|
+
<desc>
|
|
525
|
+
</desc>
|
|
526
|
+
<g tabindex="-1" id="recharts-zindex--100-:rr:">
|
|
527
|
+
</g>
|
|
528
|
+
<g tabindex="-1" id="recharts-zindex--50-:rs:">
|
|
529
|
+
</g>
|
|
530
|
+
<defs>
|
|
531
|
+
<clipPath id="recharts3-clip">
|
|
532
|
+
<rect x="5" y="5" height="258" width="335.921875">
|
|
533
|
+
</rect>
|
|
534
|
+
</clipPath>
|
|
535
|
+
</defs>
|
|
536
|
+
<g tabindex="-1" id="recharts-zindex-100-:ru:">
|
|
537
|
+
<g class="recharts-layer recharts-pie" tabindex="0">
|
|
538
|
+
<g class="recharts-layer">
|
|
539
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
540
|
+
<path cx="172.9609375" cy="134" fill="#67abc5 " stroke="#fff" name="Basistarif" color="color-coldplay-fountain" tabindex="-1" data-recharts-item-index="0" data-recharts-item-data-key="costs" class="recharts-sector" d="M 276.1609375,134
|
|
541
|
+
A 103.2,103.2,0,
|
|
542
|
+
0,0,
|
|
543
|
+
100.24957674182834,60.76545885516171
|
|
544
|
+
L 172.9609375,134 Z">
|
|
545
|
+
</path>
|
|
546
|
+
</g>
|
|
547
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
548
|
+
<path cx="172.9609375" cy="134" fill="#4eccc1 " stroke="#fff" name="Diesel" color="color-coldplay-turquoise" tabindex="-1" data-recharts-item-index="1" data-recharts-item-data-key="costs" class="recharts-sector" d="M 100.24957674182834,60.76545885516171
|
|
549
|
+
A 103.2,103.2,0,
|
|
550
|
+
0,0,
|
|
551
|
+
74.90111652929943,166.16382301894714
|
|
552
|
+
L 172.9609375,134 Z">
|
|
553
|
+
</path>
|
|
554
|
+
</g>
|
|
555
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
556
|
+
<path cx="172.9609375" cy="134" fill="#a1daa3 " stroke="#fff" name="Maut" color="color-coldplay-moos" tabindex="-1" data-recharts-item-index="2" data-recharts-item-data-key="costs" class="recharts-sector" d="M 74.90111652929943,166.16382301894714
|
|
557
|
+
A 103.2,103.2,0,
|
|
558
|
+
0,0,
|
|
559
|
+
112.11863449623375,217.3573881860384
|
|
560
|
+
L 172.9609375,134 Z">
|
|
561
|
+
</path>
|
|
562
|
+
</g>
|
|
563
|
+
</g>
|
|
564
|
+
</g>
|
|
565
|
+
</g>
|
|
566
|
+
<g tabindex="-1" id="recharts-zindex-200-:rv:">
|
|
567
|
+
</g>
|
|
568
|
+
<g tabindex="-1" id="recharts-zindex-300-:r10:">
|
|
569
|
+
</g>
|
|
570
|
+
<g tabindex="-1" id="recharts-zindex-400-:r11:">
|
|
571
|
+
</g>
|
|
572
|
+
<g tabindex="-1" id="recharts-zindex-500-:r12:">
|
|
573
|
+
</g>
|
|
574
|
+
<g tabindex="-1" id="recharts-zindex-600-:r13:">
|
|
575
|
+
</g>
|
|
576
|
+
<g tabindex="-1" id="recharts-zindex-1000-:r14:">
|
|
577
|
+
</g>
|
|
578
|
+
<g tabindex="-1" id="recharts-zindex-1100-:r15:">
|
|
579
|
+
</g>
|
|
580
|
+
<g tabindex="-1" id="recharts-zindex-1200-:r16:">
|
|
581
|
+
</g>
|
|
582
|
+
<g tabindex="-1" id="recharts-zindex-2000-:r17:">
|
|
583
|
+
</g>
|
|
584
|
+
</svg>
|
|
585
|
+
</div>
|
|
586
|
+
</div>
|
|
587
|
+
</div>
|
|
588
|
+
</div>
|
|
589
|
+
</div>
|
|
590
|
+
</div>
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
#### Props: PieChart
|
|
594
|
+
|
|
595
|
+
### PieChart
|
|
596
|
+
|
|
597
|
+
| Name | Type | Default | Description |
|
|
598
|
+
| --- | --- | --- | --- |
|
|
599
|
+
| width | Number | — | The width of chart container. |
|
|
600
|
+
| height | Number | — | The height of chart container. |
|
|
601
|
+
| innerRadius | String \| Number | 60 | The inner radius of all the sectors. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. |
|
|
602
|
+
| outerRadius | String \| Number | 80 | The outer radius of all the sectors. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. |
|
|
603
|
+
| data | Array | — | The source data, in which each element is an object. It has the following format: [{ name: "a", value: 12 }] Note: for some charts, the color of the individual data is taken from the color prop: [{ name: "a", value: 12, color: "color-coldplay-fountain" }] |
|
|
604
|
+
| dataKey | string \| number \| ((obj: T) => any) | value | The key of data used for the PieChart. |
|
|
605
|
+
| dataUnit | String \| Number | — | The unit of data displayed in the PieChart. |
|
|
606
|
+
| nameKey | String | name | The key of each sector name. |
|
|
607
|
+
| color | Function | — | Overwrite the way the color is taken from the data input array. Use this, if you had to rename the color prop in your data or if you want to provide the corresponding color in another way. Take the color name from the charts colors page. |
|
|
608
|
+
| filled | Boolean | false | Set to "true" if the chart should be filled. This will set the "innerRadius" and the "paddingAngle" to 0. |
|
|
609
|
+
| labels | Function \| Boolean | true | If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. If set a function, the function will be called to render customized label. |
|
|
610
|
+
| innerLabels | Boolean | false | Set to "true" if the built in inner label shall be used. This makes only sense when labels are enabled, and the chart is filled or the inner radius is set to 0. |
|
|
611
|
+
| paddingAngle | Number | 3 | The angle between two sectors. |
|
|
612
|
+
| pieOptions | Object | — | Detailed options passed to the underlying Pie component. Details can be found here: https://recharts.org/en-US/api/Pie |
|
|
613
|
+
| containerOptions | Object | — | Detailed options passed to the underlying ResponsiveContainer component. Details can be found here: https://recharts.org/en-US/api/ResponsiveContainer |
|
|
614
|
+
| tooltip | ChartTooltip \| Boolean | — | Defines whether or not the tooltip component shall be used. You can customize the tooltip by providing a custom ChartTooltip. Prop details can be found here: https://recharts.org/en-US/api/Tooltip. You can also customize the cursor color by setting a stroke or fill color in the cursor props. Details can be found here: https://recharts.org/en-US/api/Tooltip#cursor |
|
|
615
|
+
| legend | Legend \| Boolean | <Legend /> | Shows the provided Legend component otherwise shows nothing. |
|
|
616
|
+
| ... | | — | Additional props are passed to the underlying PieChart component. Details can be found here: https://recharts.org/en-US/api/PieChart |
|
|
617
|
+
|
|
618
|
+
#### Props: Legend
|
|
619
|
+
|
|
620
|
+
### Legend
|
|
621
|
+
|
|
622
|
+
| Name | Type | Default | Description |
|
|
623
|
+
| --- | --- | --- | --- |
|
|
624
|
+
| iconType | String | square | Defines the type of the leading icon. |
|
|
625
|
+
| iconSize | String | 12 | Defines the size of the leading icon. |
|
|
626
|
+
| layout | String | vertical | Defines the layout of the legend. |
|
|
627
|
+
| align | String | right | Defines the alignment of the legend relative to the chart. |
|
|
628
|
+
| verticalAlign | String | top | Defines the vertical alignment of the legend relative to the chart. |
|
|
629
|
+
| ... | | — | Additional props are passed to the underlying legend component. Details can be found here: https://recharts.org/en-US/api/Legend |
|
|
630
|
+
|
|
631
|
+
### Example: Basistarif
|
|
632
|
+
|
|
633
|
+
PieChart with custom legendBasistarif
|
|
634
|
+
Diesel
|
|
635
|
+
Maut
|
|
636
|
+
Zuschläge
|
|
637
|
+
|
|
638
|
+
#### Summary
|
|
639
|
+
|
|
640
|
+
PieChart with custom legendBasistarif
|
|
641
|
+
Diesel
|
|
642
|
+
Maut
|
|
643
|
+
Zuschläge
|
|
644
|
+
|
|
645
|
+
#### React (tsx)
|
|
646
|
+
|
|
647
|
+
```tsx
|
|
648
|
+
import { useState } from 'react';
|
|
649
|
+
|
|
650
|
+
import classNames from 'classnames';
|
|
651
|
+
|
|
652
|
+
import PieChart, { type PieSectorDataItem } from '@rio-cloud/rio-uikit/PieChart';
|
|
653
|
+
import Sector from '@rio-cloud/rio-uikit/Sector';
|
|
654
|
+
import Legend, { type LegendPayload } from '@rio-cloud/rio-uikit/Legend';
|
|
655
|
+
import ChartTooltip from '@rio-cloud/rio-uikit/ChartTooltip';
|
|
656
|
+
|
|
657
|
+
type CustomData = {
|
|
658
|
+
label: string;
|
|
659
|
+
color: string;
|
|
660
|
+
costs: number;
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
// Don't render the default chart tooltip as we render our own active shape
|
|
664
|
+
const NoContent = (): null => null;
|
|
665
|
+
|
|
666
|
+
export default () => {
|
|
667
|
+
const [activeItem, setActiveItem] = useState<LegendPayload | null>(null);
|
|
668
|
+
const [activeIndex, setActiveIndex] = useState<number>(0);
|
|
669
|
+
|
|
670
|
+
const handleMouseEnter = (payload: LegendPayload, index: number) => {
|
|
671
|
+
setActiveItem(payload);
|
|
672
|
+
setActiveIndex(index);
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
const renderActiveShape = (props: PieSectorDataItem) => {
|
|
676
|
+
const {
|
|
677
|
+
cx,
|
|
678
|
+
cy,
|
|
679
|
+
midAngle = 0,
|
|
680
|
+
innerRadius,
|
|
681
|
+
outerRadius,
|
|
682
|
+
startAngle,
|
|
683
|
+
endAngle,
|
|
684
|
+
fill,
|
|
685
|
+
payload,
|
|
686
|
+
percent = 0,
|
|
687
|
+
value,
|
|
688
|
+
} = props;
|
|
689
|
+
|
|
690
|
+
const RADIAN = Math.PI / 180;
|
|
691
|
+
const sin = Math.sin(-RADIAN * midAngle);
|
|
692
|
+
const cos = Math.cos(-RADIAN * midAngle);
|
|
693
|
+
const sx = cx + (outerRadius + 10) * cos;
|
|
694
|
+
const sy = cy + (outerRadius + 10) * sin;
|
|
695
|
+
const mx = cx + (outerRadius + 30) * cos;
|
|
696
|
+
const my = cy + (outerRadius + 30) * sin;
|
|
697
|
+
const ex = mx + (cos >= 0 ? 1 : -1) * 22;
|
|
698
|
+
const ey = my;
|
|
699
|
+
const textAnchor = cos >= 0 ? 'start' : 'end';
|
|
700
|
+
|
|
701
|
+
return (
|
|
702
|
+
<g>
|
|
703
|
+
<text x={cx} y={cy} dy={8} textAnchor='middle' fill={fill}>
|
|
704
|
+
{payload?.name}
|
|
705
|
+
</text>
|
|
706
|
+
<Sector
|
|
707
|
+
cx={cx}
|
|
708
|
+
cy={cy}
|
|
709
|
+
innerRadius={innerRadius}
|
|
710
|
+
outerRadius={outerRadius}
|
|
711
|
+
startAngle={startAngle}
|
|
712
|
+
endAngle={endAngle}
|
|
713
|
+
fill={fill}
|
|
714
|
+
/>
|
|
715
|
+
<Sector
|
|
716
|
+
cx={cx}
|
|
717
|
+
cy={cy}
|
|
718
|
+
startAngle={startAngle}
|
|
719
|
+
endAngle={endAngle}
|
|
720
|
+
innerRadius={outerRadius + 6}
|
|
721
|
+
outerRadius={outerRadius + 10}
|
|
722
|
+
fill={fill}
|
|
723
|
+
/>
|
|
724
|
+
<path d={`M${sx},${sy}L${mx},${my}L${ex},${ey}`} stroke={fill} fill='none' />
|
|
725
|
+
<circle cx={ex} cy={ey} r={2} fill={fill} stroke='none' />
|
|
726
|
+
<text
|
|
727
|
+
x={ex + (cos >= 0 ? 1 : -1) * 12}
|
|
728
|
+
y={ey}
|
|
729
|
+
textAnchor={textAnchor}
|
|
730
|
+
fill='#333'
|
|
731
|
+
>{`${payload?.label}:${value} €`}</text>
|
|
732
|
+
<text x={ex + (cos >= 0 ? 1 : -1) * 12} y={ey} dy={18} textAnchor={textAnchor} fill='#999'>
|
|
733
|
+
{`(Rate ${(percent * 100).toFixed(2)}%)`}
|
|
734
|
+
</text>
|
|
735
|
+
</g>
|
|
736
|
+
);
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
return (
|
|
740
|
+
<div className='max-width-600'>
|
|
741
|
+
<label>PieChart with custom legend</label>
|
|
742
|
+
<div className='panel panel-default panel-body margin-bottom-0 height-400'>
|
|
743
|
+
<PieChart
|
|
744
|
+
data={data}
|
|
745
|
+
dataKey='costs'
|
|
746
|
+
nameKey='label'
|
|
747
|
+
dataUnit='%'
|
|
748
|
+
innerRadius={90}
|
|
749
|
+
outerRadius={110}
|
|
750
|
+
// We have to render a custom tooltip to pass in the active index from hovering the legend
|
|
751
|
+
tooltip={<ChartTooltip defaultIndex={activeIndex} active content={NoContent} />}
|
|
752
|
+
pieOptions={{
|
|
753
|
+
label: false,
|
|
754
|
+
labelLine: false,
|
|
755
|
+
activeShape: renderActiveShape,
|
|
756
|
+
onMouseEnter: handleMouseEnter,
|
|
757
|
+
}}
|
|
758
|
+
legend={
|
|
759
|
+
<Legend
|
|
760
|
+
iconType='square'
|
|
761
|
+
iconSize={0}
|
|
762
|
+
onMouseEnter={handleMouseEnter}
|
|
763
|
+
formatter={(value: string | number, entry: LegendPayload) => {
|
|
764
|
+
const isActive = activeItem?.value === value;
|
|
765
|
+
|
|
766
|
+
const legendWrapperClasses = classNames(
|
|
767
|
+
'display-inline-flex',
|
|
768
|
+
'align-items-center',
|
|
769
|
+
'gap-5',
|
|
770
|
+
'cursor-pointer',
|
|
771
|
+
'padding-y-3 padding-x-5',
|
|
772
|
+
'rounded',
|
|
773
|
+
isActive && 'bg-lightest'
|
|
774
|
+
);
|
|
775
|
+
|
|
776
|
+
return (
|
|
777
|
+
<span className={legendWrapperClasses}>
|
|
778
|
+
<span
|
|
779
|
+
className='rounded height-15 width-15'
|
|
780
|
+
style={{ backgroundColor: entry.color }}
|
|
781
|
+
/>
|
|
782
|
+
<span className='text-color-dark'>{value}</span>
|
|
783
|
+
</span>
|
|
784
|
+
);
|
|
785
|
+
}}
|
|
786
|
+
/>
|
|
787
|
+
}
|
|
788
|
+
/>
|
|
789
|
+
</div>
|
|
790
|
+
</div>
|
|
791
|
+
);
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
const data: CustomData[] = [
|
|
795
|
+
{
|
|
796
|
+
label: 'Basistarif',
|
|
797
|
+
color: 'color-coldplay-fountain',
|
|
798
|
+
costs: 46.8,
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
label: 'Diesel',
|
|
802
|
+
color: 'color-coldplay-turquoise',
|
|
803
|
+
costs: 22.0,
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
label: 'Maut',
|
|
807
|
+
color: 'color-coldplay-moos',
|
|
808
|
+
costs: 12.4,
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
label: 'Zuschläge',
|
|
812
|
+
color: 'brand-warning',
|
|
813
|
+
costs: 3.88,
|
|
814
|
+
},
|
|
815
|
+
];
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
#### HTML (html)
|
|
819
|
+
|
|
820
|
+
```html
|
|
821
|
+
<div class="max-width-600">
|
|
822
|
+
<label>PieChart with custom legend</label>
|
|
823
|
+
<div class="panel panel-default panel-body margin-bottom-0 height-400">
|
|
824
|
+
<div class="recharts-responsive-container" style="width: 100%; height: 100%; min-width: 100px; min-height: 100px;">
|
|
825
|
+
<div style="width: 0px; height: 0px; overflow: visible;">
|
|
826
|
+
<div width="568" height="368" class="recharts-wrapper" style="position: relative; cursor: default; width: 568px; height: 368px;">
|
|
827
|
+
<div class="recharts-legend-wrapper" style="position: absolute; width: auto; height: auto; right: 5px; top: 5px;">
|
|
828
|
+
<ul class="recharts-default-legend" style="padding: 0px; margin: 0px; text-align: left;">
|
|
829
|
+
<li class="recharts-legend-item legend-item-0" style="display: block; margin-right: 10px;">
|
|
830
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="0" height="0" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
831
|
+
<title>
|
|
832
|
+
</title>
|
|
833
|
+
<desc>
|
|
834
|
+
</desc>
|
|
835
|
+
<path fill="#67abc5 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M-16,-16h32v32h-32Z">
|
|
836
|
+
</path>
|
|
837
|
+
</svg>
|
|
838
|
+
<span class="recharts-legend-item-text" style="color: rgb(103, 171, 197);">
|
|
839
|
+
<span class="display-inline-flex align-items-center gap-5 cursor-pointer padding-y-3 padding-x-5 rounded">
|
|
840
|
+
<span class="rounded height-15 width-15" style="background-color: rgb(103, 171, 197);">
|
|
841
|
+
</span>
|
|
842
|
+
<span class="text-color-dark">Basistarif</span>
|
|
843
|
+
</span>
|
|
844
|
+
</span>
|
|
845
|
+
</li>
|
|
846
|
+
<li class="recharts-legend-item legend-item-1" style="display: block; margin-right: 10px;">
|
|
847
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="0" height="0" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
848
|
+
<title>
|
|
849
|
+
</title>
|
|
850
|
+
<desc>
|
|
851
|
+
</desc>
|
|
852
|
+
<path fill="#4eccc1 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M-16,-16h32v32h-32Z">
|
|
853
|
+
</path>
|
|
854
|
+
</svg>
|
|
855
|
+
<span class="recharts-legend-item-text" style="color: rgb(78, 204, 193);">
|
|
856
|
+
<span class="display-inline-flex align-items-center gap-5 cursor-pointer padding-y-3 padding-x-5 rounded">
|
|
857
|
+
<span class="rounded height-15 width-15" style="background-color: rgb(78, 204, 193);">
|
|
858
|
+
</span>
|
|
859
|
+
<span class="text-color-dark">Diesel</span>
|
|
860
|
+
</span>
|
|
861
|
+
</span>
|
|
862
|
+
</li>
|
|
863
|
+
<li class="recharts-legend-item legend-item-2" style="display: block; margin-right: 10px;">
|
|
864
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="0" height="0" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
865
|
+
<title>
|
|
866
|
+
</title>
|
|
867
|
+
<desc>
|
|
868
|
+
</desc>
|
|
869
|
+
<path fill="#a1daa3 " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M-16,-16h32v32h-32Z">
|
|
870
|
+
</path>
|
|
871
|
+
</svg>
|
|
872
|
+
<span class="recharts-legend-item-text" style="color: rgb(161, 218, 163);">
|
|
873
|
+
<span class="display-inline-flex align-items-center gap-5 cursor-pointer padding-y-3 padding-x-5 rounded">
|
|
874
|
+
<span class="rounded height-15 width-15" style="background-color: rgb(161, 218, 163);">
|
|
875
|
+
</span>
|
|
876
|
+
<span class="text-color-dark">Maut</span>
|
|
877
|
+
</span>
|
|
878
|
+
</span>
|
|
879
|
+
</li>
|
|
880
|
+
<li class="recharts-legend-item legend-item-3" style="display: block; margin-right: 10px;">
|
|
881
|
+
<svg aria-label="[object Object] legend icon" class="recharts-surface" width="0" height="0" viewBox="0 0 32 32" style="display: inline-block; vertical-align: middle; margin-right: 4px;">
|
|
882
|
+
<title>
|
|
883
|
+
</title>
|
|
884
|
+
<desc>
|
|
885
|
+
</desc>
|
|
886
|
+
<path fill="#ff8e3c " cx="16" cy="16" class="recharts-symbols" transform="translate(16, 16)" d="M-16,-16h32v32h-32Z">
|
|
887
|
+
</path>
|
|
888
|
+
</svg>
|
|
889
|
+
<span class="recharts-legend-item-text" style="color: rgb(255, 142, 60);">
|
|
890
|
+
<span class="display-inline-flex align-items-center gap-5 cursor-pointer padding-y-3 padding-x-5 rounded">
|
|
891
|
+
<span class="rounded height-15 width-15" style="background-color: rgb(255, 142, 60);">
|
|
892
|
+
</span>
|
|
893
|
+
<span class="text-color-dark">Zuschläge</span>
|
|
894
|
+
</span>
|
|
895
|
+
</span>
|
|
896
|
+
</li>
|
|
897
|
+
</ul>
|
|
898
|
+
</div>
|
|
899
|
+
<div xmlns="http://www.w3.org/1999/xhtml" tabindex="-1" class="recharts-tooltip-wrapper" style="transition: transform 400ms; visibility: visible; pointer-events: none; position: absolute; top: 0px; left: 0px;">
|
|
900
|
+
</div>
|
|
901
|
+
<svg cx="50%" cy="50%" role="application" tabindex="0" class="recharts-surface" width="568" height="368" viewBox="0 0 568 368" style="width: 100%; height: 100%; display: block;">
|
|
902
|
+
<title>
|
|
903
|
+
</title>
|
|
904
|
+
<desc>
|
|
905
|
+
</desc>
|
|
906
|
+
<g tabindex="-1" id="recharts-zindex--100-:r18:">
|
|
907
|
+
</g>
|
|
908
|
+
<g tabindex="-1" id="recharts-zindex--50-:r19:">
|
|
909
|
+
</g>
|
|
910
|
+
<defs>
|
|
911
|
+
<clipPath id="recharts4-clip">
|
|
912
|
+
<rect x="5" y="5" height="358" width="458.859375">
|
|
913
|
+
</rect>
|
|
914
|
+
</clipPath>
|
|
915
|
+
</defs>
|
|
916
|
+
<g tabindex="-1" id="recharts-zindex-100-:r1b:">
|
|
917
|
+
<g class="recharts-layer recharts-pie" tabindex="0">
|
|
918
|
+
<g class="recharts-layer">
|
|
919
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
920
|
+
<g class="recharts-layer recharts-active-shape">
|
|
921
|
+
<g>
|
|
922
|
+
<text x="234.4296875" y="184" dy="8" text-anchor="middle" fill="#67abc5 ">
|
|
923
|
+
</text>
|
|
924
|
+
<path cx="234.4296875" cy="184" fill="#67abc5 " class="recharts-sector" d="M 344.4296875,184
|
|
925
|
+
A 110,110,0,
|
|
926
|
+
1,0,
|
|
927
|
+
126.02621365284715,202.67315875447025
|
|
928
|
+
L 145.7359361705113,199.2780389809302
|
|
929
|
+
A 90,90,0,
|
|
930
|
+
1,1,
|
|
931
|
+
324.4296875,184 Z">
|
|
932
|
+
</path>
|
|
933
|
+
<path cx="234.4296875" cy="184" fill="#67abc5 " class="recharts-sector" d="M 354.4296875,184
|
|
934
|
+
A 120,120,0,
|
|
935
|
+
1,0,
|
|
936
|
+
116.17135239401507,204.37071864124027
|
|
937
|
+
L 120.11329689754791,203.69169468653226
|
|
938
|
+
A 116,116,0,
|
|
939
|
+
1,1,
|
|
940
|
+
350.4296875,184 Z">
|
|
941
|
+
</path>
|
|
942
|
+
<path d="M222.48574496401073,64.59588685184674L220.4950878746792,44.695201327154535L198.4950878746792,44.695201327154535" stroke="#67abc5 " fill="none">
|
|
943
|
+
</path>
|
|
944
|
+
<circle cx="198.4950878746792" cy="44.695201327154535" r="2" fill="#67abc5 " stroke="none">
|
|
945
|
+
</circle>
|
|
946
|
+
<text x="186.4950878746792" y="44.695201327154535" text-anchor="end" fill="#333">Basistarif:46.8 €</text>
|
|
947
|
+
<text x="186.4950878746792" y="44.695201327154535" dy="18" text-anchor="end" fill="#999">(Rate 55.01%)</text>
|
|
948
|
+
</g>
|
|
949
|
+
</g>
|
|
950
|
+
</g>
|
|
951
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
952
|
+
<path cx="234.4296875" cy="184" fill="#4eccc1 " stroke="#fff" name="Diesel" color="color-coldplay-turquoise" tabindex="-1" data-recharts-item-index="1" data-recharts-item-data-key="costs" class="recharts-sector" d="M 127.15205446572965,208.32096730322263
|
|
953
|
+
A 110,110,0,
|
|
954
|
+
0,0,
|
|
955
|
+
257.2689101523764,291.6028341106087
|
|
956
|
+
L 253.1163242155807,272.0386824541344
|
|
957
|
+
A 90,90,0,
|
|
958
|
+
0,1,
|
|
959
|
+
146.6570786537788,203.89897324809124 Z">
|
|
960
|
+
</path>
|
|
961
|
+
</g>
|
|
962
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
963
|
+
<path cx="234.4296875" cy="184" fill="#a1daa3 " stroke="#fff" name="Maut" color="color-coldplay-moos" tabindex="-1" data-recharts-item-index="2" data-recharts-item-data-key="costs" class="recharts-sector" d="M 262.8691070091283,290.26005560879315
|
|
964
|
+
A 110,110,0,
|
|
965
|
+
0,0,
|
|
966
|
+
334.33778017393547,230.02578644908002
|
|
967
|
+
L 316.1726724150381,221.65746164015638
|
|
968
|
+
A 90,90,0,
|
|
969
|
+
0,1,
|
|
970
|
+
257.69830346201405,270.9400454981035 Z">
|
|
971
|
+
</path>
|
|
972
|
+
</g>
|
|
973
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
974
|
+
<path cx="234.4296875" cy="184" fill="#ff8e3c " stroke="#fff" name="Zuschläge" color="brand-warning" tabindex="-1" data-recharts-item-index="3" data-recharts-item-data-key="costs" class="recharts-sector" d="M 336.60966315083516,224.73392414185915
|
|
975
|
+
A 110,110,0,
|
|
976
|
+
0,0,
|
|
977
|
+
343.82684131063615,195.50055381849145
|
|
978
|
+
L 323.9364497087023,193.4095440333112
|
|
979
|
+
A 90,90,0,
|
|
980
|
+
0,1,
|
|
981
|
+
318.0314857597742,217.32775611606658 Z">
|
|
982
|
+
</path>
|
|
983
|
+
</g>
|
|
984
|
+
</g>
|
|
985
|
+
</g>
|
|
986
|
+
</g>
|
|
987
|
+
<g tabindex="-1" id="recharts-zindex-200-:r1c:">
|
|
988
|
+
</g>
|
|
989
|
+
<g tabindex="-1" id="recharts-zindex-300-:r1d:">
|
|
990
|
+
</g>
|
|
991
|
+
<g tabindex="-1" id="recharts-zindex-400-:r1e:">
|
|
992
|
+
</g>
|
|
993
|
+
<g tabindex="-1" id="recharts-zindex-500-:r1f:">
|
|
994
|
+
</g>
|
|
995
|
+
<g tabindex="-1" id="recharts-zindex-600-:r1g:">
|
|
996
|
+
</g>
|
|
997
|
+
<g tabindex="-1" id="recharts-zindex-1000-:r1h:">
|
|
998
|
+
</g>
|
|
999
|
+
<g tabindex="-1" id="recharts-zindex-1100-:r1i:">
|
|
1000
|
+
</g>
|
|
1001
|
+
<g tabindex="-1" id="recharts-zindex-1200-:r1j:">
|
|
1002
|
+
</g>
|
|
1003
|
+
<g tabindex="-1" id="recharts-zindex-2000-:r1k:">
|
|
1004
|
+
</g>
|
|
1005
|
+
</svg>
|
|
1006
|
+
</div>
|
|
1007
|
+
</div>
|
|
1008
|
+
</div>
|
|
1009
|
+
</div>
|
|
1010
|
+
</div>
|
|
1011
|
+
```
|
|
1012
|
+
|
|
1013
|
+
#### Props: PieChart
|
|
1014
|
+
|
|
1015
|
+
### PieChart
|
|
1016
|
+
|
|
1017
|
+
| Name | Type | Default | Description |
|
|
1018
|
+
| --- | --- | --- | --- |
|
|
1019
|
+
| width | Number | — | The width of chart container. |
|
|
1020
|
+
| height | Number | — | The height of chart container. |
|
|
1021
|
+
| innerRadius | String \| Number | 60 | The inner radius of all the sectors. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. |
|
|
1022
|
+
| outerRadius | String \| Number | 80 | The outer radius of all the sectors. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. |
|
|
1023
|
+
| data | Array | — | The source data, in which each element is an object. It has the following format: [{ name: "a", value: 12 }] Note: for some charts, the color of the individual data is taken from the color prop: [{ name: "a", value: 12, color: "color-coldplay-fountain" }] |
|
|
1024
|
+
| dataKey | string \| number \| ((obj: T) => any) | value | The key of data used for the PieChart. |
|
|
1025
|
+
| dataUnit | String \| Number | — | The unit of data displayed in the PieChart. |
|
|
1026
|
+
| nameKey | String | name | The key of each sector name. |
|
|
1027
|
+
| color | Function | — | Overwrite the way the color is taken from the data input array. Use this, if you had to rename the color prop in your data or if you want to provide the corresponding color in another way. Take the color name from the charts colors page. |
|
|
1028
|
+
| filled | Boolean | false | Set to "true" if the chart should be filled. This will set the "innerRadius" and the "paddingAngle" to 0. |
|
|
1029
|
+
| labels | Function \| Boolean | true | If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. If set a function, the function will be called to render customized label. |
|
|
1030
|
+
| innerLabels | Boolean | false | Set to "true" if the built in inner label shall be used. This makes only sense when labels are enabled, and the chart is filled or the inner radius is set to 0. |
|
|
1031
|
+
| paddingAngle | Number | 3 | The angle between two sectors. |
|
|
1032
|
+
| pieOptions | Object | — | Detailed options passed to the underlying Pie component. Details can be found here: https://recharts.org/en-US/api/Pie |
|
|
1033
|
+
| containerOptions | Object | — | Detailed options passed to the underlying ResponsiveContainer component. Details can be found here: https://recharts.org/en-US/api/ResponsiveContainer |
|
|
1034
|
+
| tooltip | ChartTooltip \| Boolean | — | Defines whether or not the tooltip component shall be used. You can customize the tooltip by providing a custom ChartTooltip. Prop details can be found here: https://recharts.org/en-US/api/Tooltip. You can also customize the cursor color by setting a stroke or fill color in the cursor props. Details can be found here: https://recharts.org/en-US/api/Tooltip#cursor |
|
|
1035
|
+
| legend | Legend \| Boolean | <Legend /> | Shows the provided Legend component otherwise shows nothing. |
|
|
1036
|
+
| ... | | — | Additional props are passed to the underlying PieChart component. Details can be found here: https://recharts.org/en-US/api/PieChart |
|
|
1037
|
+
|
|
1038
|
+
#### Props: Legend
|
|
1039
|
+
|
|
1040
|
+
### Legend
|
|
1041
|
+
|
|
1042
|
+
| Name | Type | Default | Description |
|
|
1043
|
+
| --- | --- | --- | --- |
|
|
1044
|
+
| iconType | String | square | Defines the type of the leading icon. |
|
|
1045
|
+
| iconSize | String | 12 | Defines the size of the leading icon. |
|
|
1046
|
+
| layout | String | vertical | Defines the layout of the legend. |
|
|
1047
|
+
| align | String | right | Defines the alignment of the legend relative to the chart. |
|
|
1048
|
+
| verticalAlign | String | top | Defines the vertical alignment of the legend relative to the chart. |
|
|
1049
|
+
| ... | | — | Additional props are passed to the underlying legend component. Details can be found here: https://recharts.org/en-US/api/Legend |
|
|
1050
|
+
|
|
1051
|
+
### Example: Customer Satisfaction
|
|
1052
|
+
|
|
1053
|
+
PieChart with a needle
|
|
1054
|
+
|
|
1055
|
+
Customer Satisfaction
|
|
1056
|
+
|
|
1057
|
+
#### Summary
|
|
1058
|
+
|
|
1059
|
+
PieChart with a needle
|
|
1060
|
+
|
|
1061
|
+
Customer Satisfaction
|
|
1062
|
+
|
|
1063
|
+
#### React (tsx)
|
|
1064
|
+
|
|
1065
|
+
```tsx
|
|
1066
|
+
import PieChart from '@rio-cloud/rio-uikit/PieChart';
|
|
1067
|
+
import ChartNeedle from '@rio-cloud/rio-uikit/ChartNeedle';
|
|
1068
|
+
|
|
1069
|
+
export default () => {
|
|
1070
|
+
return (
|
|
1071
|
+
<>
|
|
1072
|
+
<label>PieChart with a needle</label>
|
|
1073
|
+
<div className='panel panel-default panel-body margin-bottom-0 '>
|
|
1074
|
+
<div className='display-flex flex-column position-relative width-250 height-250 max-width-500'>
|
|
1075
|
+
<PieChart
|
|
1076
|
+
data={data}
|
|
1077
|
+
dataKey='value'
|
|
1078
|
+
filled={false}
|
|
1079
|
+
paddingAngle={1}
|
|
1080
|
+
innerRadius={90}
|
|
1081
|
+
outerRadius={98}
|
|
1082
|
+
labels={false}
|
|
1083
|
+
legend={false}
|
|
1084
|
+
tooltip={false}
|
|
1085
|
+
containerOptions={{ height: '50%' }}
|
|
1086
|
+
pieOptions={{
|
|
1087
|
+
startAngle: 180,
|
|
1088
|
+
endAngle: 0,
|
|
1089
|
+
cy: 120,
|
|
1090
|
+
}}
|
|
1091
|
+
/>
|
|
1092
|
+
<div className='position-absolute top-25pct left-50pct'>
|
|
1093
|
+
<ChartNeedle rotation={67} height='80px' y='-30%' />
|
|
1094
|
+
</div>
|
|
1095
|
+
<div className='margin-20 text-center'>
|
|
1096
|
+
<div className='text-color-dark text-size-16'>Customer Satisfaction</div>
|
|
1097
|
+
</div>
|
|
1098
|
+
</div>
|
|
1099
|
+
</div>
|
|
1100
|
+
</>
|
|
1101
|
+
);
|
|
1102
|
+
};
|
|
1103
|
+
|
|
1104
|
+
const data = [
|
|
1105
|
+
{
|
|
1106
|
+
color: 'color-rating-1',
|
|
1107
|
+
value: 20,
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
color: 'color-rating-2',
|
|
1111
|
+
value: 20,
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
color: 'color-rating-3',
|
|
1115
|
+
value: 20,
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
color: 'color-rating-4',
|
|
1119
|
+
value: 20,
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
color: 'color-rating-5',
|
|
1123
|
+
value: 20,
|
|
1124
|
+
},
|
|
1125
|
+
];
|
|
1126
|
+
```
|
|
1127
|
+
|
|
1128
|
+
#### HTML (html)
|
|
1129
|
+
|
|
1130
|
+
```html
|
|
1131
|
+
<label>PieChart with a needle</label>
|
|
1132
|
+
<div class="panel panel-default panel-body margin-bottom-0 ">
|
|
1133
|
+
<div class="display-flex flex-column position-relative width-250 height-250 max-width-500">
|
|
1134
|
+
<div class="recharts-responsive-container" style="width: 100%; height: 50%; min-width: 100px; min-height: 100px;">
|
|
1135
|
+
<div style="width: 0px; height: 0px; overflow: visible;">
|
|
1136
|
+
<div width="250" height="125" class="recharts-wrapper" style="position: relative; cursor: default; width: 250px; height: 125px;">
|
|
1137
|
+
<svg cx="50%" cy="50%" role="application" tabindex="0" class="recharts-surface" width="250" height="125" viewBox="0 0 250 125" style="width: 100%; height: 100%; display: block;">
|
|
1138
|
+
<title>
|
|
1139
|
+
</title>
|
|
1140
|
+
<desc>
|
|
1141
|
+
</desc>
|
|
1142
|
+
<g tabindex="-1" id="recharts-zindex--100-:r1l:">
|
|
1143
|
+
</g>
|
|
1144
|
+
<g tabindex="-1" id="recharts-zindex--50-:r1m:">
|
|
1145
|
+
</g>
|
|
1146
|
+
<defs>
|
|
1147
|
+
<clipPath id="recharts5-clip">
|
|
1148
|
+
<rect x="5" y="5" height="115" width="240">
|
|
1149
|
+
</rect>
|
|
1150
|
+
</clipPath>
|
|
1151
|
+
</defs>
|
|
1152
|
+
<g tabindex="-1" id="recharts-zindex-100-:r1o:">
|
|
1153
|
+
<g class="recharts-layer recharts-pie" tabindex="0">
|
|
1154
|
+
<g class="recharts-layer">
|
|
1155
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
1156
|
+
<path cy="125" cx="125" fill="#e22837 " stroke="#fff" name="0" color="color-rating-1" tabindex="-1" data-recharts-item-index="0" data-recharts-item-data-key="value" class="recharts-sector" d="M 27,124.99999999999999
|
|
1157
|
+
A 98,98,0,
|
|
1158
|
+
0,1,
|
|
1159
|
+
44.91979996315739,68.5096330153603
|
|
1160
|
+
L 51.45695914983841,73.12109154471864
|
|
1161
|
+
A 90,90,0,
|
|
1162
|
+
0,0,
|
|
1163
|
+
35,124.99999999999999 Z">
|
|
1164
|
+
</path>
|
|
1165
|
+
</g>
|
|
1166
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
1167
|
+
<path cy="125" cx="125" fill="#ff8e3c " stroke="#fff" name="1" color="color-rating-2" tabindex="-1" data-recharts-item-index="1" data-recharts-item-data-key="value" class="recharts-sector" d="M 45.9178894099074,67.12064457324732
|
|
1168
|
+
A 98,98,0,
|
|
1169
|
+
0,1,
|
|
1170
|
+
93.74198768878912,32.118695819060605
|
|
1171
|
+
L 96.29366216317369,39.70084309913729
|
|
1172
|
+
A 90,90,0,
|
|
1173
|
+
0,0,
|
|
1174
|
+
52.37357190705782,71.84548991420672 Z">
|
|
1175
|
+
</path>
|
|
1176
|
+
</g>
|
|
1177
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
1178
|
+
<path cy="125" cx="125" fill="#f8c575 " stroke="#fff" name="2" color="color-rating-3" tabindex="-1" data-recharts-item-index="2" data-recharts-item-data-key="value" class="recharts-sector" d="M 95.36775070645643,31.587314556291204
|
|
1179
|
+
A 98,98,0,
|
|
1180
|
+
0,1,
|
|
1181
|
+
154.63224929354354,31.58731455629119
|
|
1182
|
+
L 152.21329016753998,39.21283989863477
|
|
1183
|
+
A 90,90,0,
|
|
1184
|
+
0,0,
|
|
1185
|
+
97.78670983245999,39.21283989863478 Z">
|
|
1186
|
+
</path>
|
|
1187
|
+
</g>
|
|
1188
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
1189
|
+
<path cy="125" cx="125" fill="#5cb85c " stroke="#fff" name="3" color="color-rating-4" tabindex="-1" data-recharts-item-index="3" data-recharts-item-data-key="value" class="recharts-sector" d="M 156.25801231121085,32.11869581906059
|
|
1190
|
+
A 98,98,0,
|
|
1191
|
+
0,1,
|
|
1192
|
+
204.08211059009258,67.12064457324732
|
|
1193
|
+
L 197.62642809294218,71.84548991420672
|
|
1194
|
+
A 90,90,0,
|
|
1195
|
+
0,0,
|
|
1196
|
+
153.7063378368263,39.70084309913727 Z">
|
|
1197
|
+
</path>
|
|
1198
|
+
</g>
|
|
1199
|
+
<g class="recharts-layer recharts-pie-sector" tabindex="-1">
|
|
1200
|
+
<path cy="125" cx="125" fill="#4b924c " stroke="#fff" name="4" color="color-rating-5" tabindex="-1" data-recharts-item-index="4" data-recharts-item-data-key="value" class="recharts-sector" d="M 205.0802000368426,68.50963301536027
|
|
1201
|
+
A 98,98,0,
|
|
1202
|
+
0,1,
|
|
1203
|
+
223,125
|
|
1204
|
+
L 215,125
|
|
1205
|
+
A 90,90,0,
|
|
1206
|
+
0,0,
|
|
1207
|
+
198.54304085016156,73.12109154471861 Z">
|
|
1208
|
+
</path>
|
|
1209
|
+
</g>
|
|
1210
|
+
</g>
|
|
1211
|
+
</g>
|
|
1212
|
+
</g>
|
|
1213
|
+
<g tabindex="-1" id="recharts-zindex-200-:r1p:">
|
|
1214
|
+
</g>
|
|
1215
|
+
<g tabindex="-1" id="recharts-zindex-300-:r1q:">
|
|
1216
|
+
</g>
|
|
1217
|
+
<g tabindex="-1" id="recharts-zindex-400-:r1r:">
|
|
1218
|
+
</g>
|
|
1219
|
+
<g tabindex="-1" id="recharts-zindex-500-:r1s:">
|
|
1220
|
+
</g>
|
|
1221
|
+
<g tabindex="-1" id="recharts-zindex-600-:r1t:">
|
|
1222
|
+
</g>
|
|
1223
|
+
<g tabindex="-1" id="recharts-zindex-1000-:r1u:">
|
|
1224
|
+
</g>
|
|
1225
|
+
<g tabindex="-1" id="recharts-zindex-1100-:r1v:">
|
|
1226
|
+
</g>
|
|
1227
|
+
<g tabindex="-1" id="recharts-zindex-1200-:r20:">
|
|
1228
|
+
</g>
|
|
1229
|
+
<g tabindex="-1" id="recharts-zindex-2000-:r21:">
|
|
1230
|
+
</g>
|
|
1231
|
+
</svg>
|
|
1232
|
+
</div>
|
|
1233
|
+
</div>
|
|
1234
|
+
</div>
|
|
1235
|
+
<div class="position-absolute top-25pct left-50pct">
|
|
1236
|
+
<div class="position-relative">
|
|
1237
|
+
<div class="position-absolute bg-dark " style="width: 5px; height: 80px; transform-origin: center bottom; transform: translate(-50%, -30%) rotate(67deg); border-radius: 100% 100% 4px 4px; display: inline-block;">
|
|
1238
|
+
</div>
|
|
1239
|
+
</div>
|
|
1240
|
+
</div>
|
|
1241
|
+
<div class="margin-20 text-center">
|
|
1242
|
+
<div class="text-color-dark text-size-16">Customer Satisfaction</div>
|
|
1243
|
+
</div>
|
|
1244
|
+
</div>
|
|
1245
|
+
</div>
|
|
1246
|
+
```
|
|
1247
|
+
|
|
1248
|
+
#### Props: PieChart
|
|
1249
|
+
|
|
1250
|
+
### PieChart
|
|
1251
|
+
|
|
1252
|
+
| Name | Type | Default | Description |
|
|
1253
|
+
| --- | --- | --- | --- |
|
|
1254
|
+
| width | Number | — | The width of chart container. |
|
|
1255
|
+
| height | Number | — | The height of chart container. |
|
|
1256
|
+
| innerRadius | String \| Number | 60 | The inner radius of all the sectors. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. |
|
|
1257
|
+
| outerRadius | String \| Number | 80 | The outer radius of all the sectors. If set a percentage, the final value is obtained by multiplying the percentage of maxRadius which is calculated by the width, height, cx, cy. |
|
|
1258
|
+
| data | Array | — | The source data, in which each element is an object. It has the following format: [{ name: "a", value: 12 }] Note: for some charts, the color of the individual data is taken from the color prop: [{ name: "a", value: 12, color: "color-coldplay-fountain" }] |
|
|
1259
|
+
| dataKey | string \| number \| ((obj: T) => any) | value | The key of data used for the PieChart. |
|
|
1260
|
+
| dataUnit | String \| Number | — | The unit of data displayed in the PieChart. |
|
|
1261
|
+
| nameKey | String | name | The key of each sector name. |
|
|
1262
|
+
| color | Function | — | Overwrite the way the color is taken from the data input array. Use this, if you had to rename the color prop in your data or if you want to provide the corresponding color in another way. Take the color name from the charts colors page. |
|
|
1263
|
+
| filled | Boolean | false | Set to "true" if the chart should be filled. This will set the "innerRadius" and the "paddingAngle" to 0. |
|
|
1264
|
+
| labels | Function \| Boolean | true | If false set, labels will not be drawn. If true set, labels will be drawn which have the props calculated internally. If set a function, the function will be called to render customized label. |
|
|
1265
|
+
| innerLabels | Boolean | false | Set to "true" if the built in inner label shall be used. This makes only sense when labels are enabled, and the chart is filled or the inner radius is set to 0. |
|
|
1266
|
+
| paddingAngle | Number | 3 | The angle between two sectors. |
|
|
1267
|
+
| pieOptions | Object | — | Detailed options passed to the underlying Pie component. Details can be found here: https://recharts.org/en-US/api/Pie |
|
|
1268
|
+
| containerOptions | Object | — | Detailed options passed to the underlying ResponsiveContainer component. Details can be found here: https://recharts.org/en-US/api/ResponsiveContainer |
|
|
1269
|
+
| tooltip | ChartTooltip \| Boolean | — | Defines whether or not the tooltip component shall be used. You can customize the tooltip by providing a custom ChartTooltip. Prop details can be found here: https://recharts.org/en-US/api/Tooltip. You can also customize the cursor color by setting a stroke or fill color in the cursor props. Details can be found here: https://recharts.org/en-US/api/Tooltip#cursor |
|
|
1270
|
+
| legend | Legend \| Boolean | <Legend /> | Shows the provided Legend component otherwise shows nothing. |
|
|
1271
|
+
| ... | | — | Additional props are passed to the underlying PieChart component. Details can be found here: https://recharts.org/en-US/api/PieChart |
|
|
1272
|
+
|
|
1273
|
+
#### Props: Legend
|
|
1274
|
+
|
|
1275
|
+
### Legend
|
|
1276
|
+
|
|
1277
|
+
| Name | Type | Default | Description |
|
|
1278
|
+
| --- | --- | --- | --- |
|
|
1279
|
+
| iconType | String | square | Defines the type of the leading icon. |
|
|
1280
|
+
| iconSize | String | 12 | Defines the size of the leading icon. |
|
|
1281
|
+
| layout | String | vertical | Defines the layout of the legend. |
|
|
1282
|
+
| align | String | right | Defines the alignment of the legend relative to the chart. |
|
|
1283
|
+
| verticalAlign | String | top | Defines the vertical alignment of the legend relative to the chart. |
|
|
1284
|
+
| ... | | — | Additional props are passed to the underlying legend component. Details can be found here: https://recharts.org/en-US/api/Legend |
|