Skip to content

Commit

Permalink
feat(line): add ability to disable stack tooltip on line chart
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte committed Aug 12, 2017
1 parent ccdb2e6 commit 732d170
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/charts/line/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ const Line = ({
motionStiffness,
motionDamping,

// interactivity
isInteractive,

// stackTooltip
enableStackTooltip,
}) => {
const motionProps = {
animate,
Expand Down Expand Up @@ -107,6 +111,7 @@ const Line = ({
/>
<LineLines lines={lines} lineGenerator={lineGenerator} {...motionProps} />
{isInteractive &&
enableStackTooltip &&
<LineSlices
slices={slices}
height={height}
Expand Down Expand Up @@ -188,7 +193,11 @@ Line.propTypes = {
// motion
...motionPropTypes,

// interactivity
isInteractive: PropTypes.bool.isRequired,

// stack tooltip
enableStackTooltip: PropTypes.bool.isRequired,
}

export const LineDefaultProps = {
Expand Down Expand Up @@ -219,7 +228,11 @@ export const LineDefaultProps = {
motionStiffness: Nivo.defaults.motionStiffness,
motionDamping: Nivo.defaults.motionDamping,

// interactivity
isInteractive: true,

// stack tooltip
enableStackTooltip: true,
}

const enhance = compose(
Expand Down

0 comments on commit 732d170

Please sign in to comment.