Skip to content

Commit

Permalink
docs(pie): add examples for custom tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte committed May 30, 2018
1 parent d373442 commit a309abe
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/nivo-pie/stories/pie.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ stories.add('custom radial label', () => (
/>
))

stories.add('with formatted values', () => (
stories.add('formatted tooltip values', () => (
<Pie
{...commonProperties}
tooltipFormat={value =>
Expand All @@ -59,3 +59,22 @@ stories.add('with formatted values', () => (
}
/>
))

stories.add('custom tooltip', () => (
<Pie
{...commonProperties}
tooltip={({ id, value, color }) => (
<strong style={{ color }}>
{id}: {value}
</strong>
)}
theme={{
tooltip: {
container: {
background: '#333',
},
},
}}
/>
))

0 comments on commit a309abe

Please sign in to comment.