diff --git a/packages/nivo-line/src/Line.js b/packages/nivo-line/src/Line.js
index 476a3791b..a547d6aad 100644
--- a/packages/nivo-line/src/Line.js
+++ b/packages/nivo-line/src/Line.js
@@ -166,10 +166,12 @@ const Line = ({
/>
)}
{legends.map((legend, i) => {
- const legendData = lines.map(line => ({
- label: line.id,
- fill: line.color
- })).reverse()
+ const legendData = lines
+ .map(line => ({
+ label: line.id,
+ fill: line.color,
+ }))
+ .reverse()
return (
+ See the dedicated guide on how to setup + legends for this component. +
) diff --git a/website/src/components/charts/line/LinePage.js b/website/src/components/charts/line/LinePage.js index 3c0a00fba..1c9a0d1e1 100644 --- a/website/src/components/charts/line/LinePage.js +++ b/website/src/components/charts/line/LinePage.js @@ -10,7 +10,7 @@ import React, { Component } from 'react' import Helmet from 'react-helmet' import { generateDrinkStats } from '@nivo/generators' -const generateData = () => generateDrinkStats(12) +const generateData = () => generateDrinkStats(9) class LinePage extends Component { state = { diff --git a/website/src/components/charts/radar/Radar.js b/website/src/components/charts/radar/Radar.js index 4cbe5c938..8994d2716 100644 --- a/website/src/components/charts/radar/Radar.js +++ b/website/src/components/charts/radar/Radar.js @@ -10,10 +10,10 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import MediaQuery from 'react-responsive' import { Link } from 'react-router-dom' +import { ResponsiveRadar } from '@nivo/radar' import ChartHeader from '../../ChartHeader' import ChartTabs from '../../ChartTabs' import RadarControls from './RadarControls' -import { ResponsiveRadar } from '@nivo/radar' import generateCode from '../../../lib/generateChartCode' import ComponentPropsDocumentation from '../../properties/ComponentPropsDocumentation' import properties from './props' @@ -67,6 +67,19 @@ export default class Radar extends Component { motionDamping: 15, isInteractive: true, + + legends: [ + { + anchor: 'top-left', + direction: 'column', + translateX: -50, + translateY: -40, + itemWidth: 80, + itemHeight: 20, + symbolSize: 12, + symbolShape: 'circle', + }, + ], }, }