The Choropleth component displays divided geographical areas shaded in relation to - some data variable. It's build on top of the GeoMap{' '} - component. + some data variable. It's build on top of primitives from the{' '} + GeoMap component.
Using this component requires some knowledge about the d3-geo
library,
diff --git a/website/src/components/charts/geo/ChoroplethCanvas.js b/website/src/components/charts/geo/ChoroplethCanvas.js
index f0aa1a7d5..48d627ed7 100644
--- a/website/src/components/charts/geo/ChoroplethCanvas.js
+++ b/website/src/components/charts/geo/ChoroplethCanvas.js
@@ -55,6 +55,23 @@ const initialSettings = {
isInteractive: true,
'custom tooltip example': false,
+ legends: [
+ {
+ anchor: 'bottom-left',
+ direction: 'column',
+ justify: true,
+ translateX: 20,
+ translateY: -60,
+ itemsSpacing: 0,
+ itemWidth: 86,
+ itemHeight: 18,
+ itemDirection: 'left-to-right',
+ itemTextColor: '#e6f6cf',
+ itemOpacity: 0.85,
+ symbolSize: 18,
+ },
+ ],
+
theme: {
...nivoTheme,
background: '#1f294a',
diff --git a/website/src/components/charts/geo/props.js b/website/src/components/charts/geo/props.js
index 4398cc79b..ab941fbe1 100644
--- a/website/src/components/charts/geo/props.js
+++ b/website/src/components/charts/geo/props.js
@@ -8,7 +8,7 @@
*/
import React from 'react'
import { GeoMapDefaultProps, ChoroplethDefaultProps } from '@nivo/geo'
-import { marginProperties, defsProperties } from '../../../lib/componentProperties'
+import { marginProperties, defsProperties, getLegendsProps } from '../../../lib/componentProperties'
export default [
{
@@ -366,10 +366,9 @@ export default [