From b425e35f6ff5061023b77b1d8d41b1e118b18d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Benitte?= Date: Mon, 27 Aug 2018 14:11:51 +0900 Subject: [PATCH] feat(line): add story about negative values highlight --- packages/line/stories/line.stories.js | 134 +++++++++++++++++---- website/src/components/charts/line/Line.js | 16 +-- 2 files changed, 114 insertions(+), 36 deletions(-) diff --git a/packages/line/stories/line.stories.js b/packages/line/stories/line.stories.js index d9ca66cc8..7e24c6955 100644 --- a/packages/line/stories/line.stories.js +++ b/packages/line/stories/line.stories.js @@ -16,6 +16,19 @@ const commonProperties = { const curveOptions = ['linear', 'monotoneX'] +const CustomSymbol = ({ size, color, borderWidth, borderColor }) => ( + + + + +) + const stories = storiesOf('Line', module) stories.addDecorator(story =>
{story()}
).addDecorator(withKnobs) @@ -210,19 +223,6 @@ stories.add( )) ) -const CustomSymbol = ({ size, color, borderWidth, borderColor }) => ( - - - - -) - stories.add( 'custom dot symbol', withInfo()(() => ( @@ -324,7 +324,11 @@ stories.add( stories.add( 'different serie lengths', - withInfo()(() => ( + withInfo(` + Please note that when using stacked y scale with variable length/data holes, + if one of the y value is \`null\` all subsequent values will be skipped + as we cannot compute the sum. + `)(() => ( ( + + )) +) + stories.add( 'formatting axis values', withInfo()(() => ( diff --git a/website/src/components/charts/line/Line.js b/website/src/components/charts/line/Line.js index 685619503..9c40c4b9f 100644 --- a/website/src/components/charts/line/Line.js +++ b/website/src/components/charts/line/Line.js @@ -82,8 +82,9 @@ export default class Line extends Component {

Line chart with stacking ability.

Given an array of data series having an id and a nested array of points (with x, - y properties), it will compute the line for each data serie.  If stacked is - true, y values will be automatically aggregated. + y properties), it will compute the line for each data serie. All datum having + null x or y will be treated as holes, thus portions of the corresponding line + will be skipped.

The responsive alternative of this component is ResponsiveLine. @@ -105,16 +106,7 @@ export default class Line extends Component { > sample {' '} - or try it using the API client. You can also see - more example usages in{' '} - - the storybook - - . + or try it using the API client.

See the dedicated guide on how to setup