Skip to content

Commit 34fb179

Browse files
author
Rob Clayburn
committed
pie chart tip display function, supply custom colourScheme
1 parent a24b6f7 commit 34fb179

File tree

14 files changed

+2208
-6219
lines changed

14 files changed

+2208
-6219
lines changed

dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/examples.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as d3 from 'd3';
22
import * as React from 'react';
33
import * as ReactDOM from 'react-dom';
44
import { Histogram, HorizontalHistogram, LineChart, PieChart, ScatterPlot } from '../src';
5+
import filterRange from '../src/colors/filterRange';
56

67
const grid = {
78
x: {
@@ -145,9 +146,18 @@ const legend = {
145146
};
146147

147148
const labels = {
148-
display: false,
149+
display: true,
149150
};
150151

152+
const theme = filterRange(['rgba(255, 113, 1, 0.5)', '#fff6ef', 'rgba(0, 169, 123, 0.5)', '#f6fffd',
153+
'#D7263D', 'rgba(215, 38, 61, 0.05)',
154+
'#0f2629', '#ededed', 'rgba(86, 180, 191, 0.5)', '#f5fbfb', '#000000', '#0f2629', '#D7263D', '#FBD7D9',
155+
'#ffebec', '#963540', '#22545a', '#56b4bf', '#56b4bf', '#56b4bf', '#FF7101', '#449098', '#77c3cb', '#d4eef8',
156+
'#ff7101', '#FF7101', '#cc5a00', '#ff8d33', '#fef9e5', '#7d5d2e', '#00a97b', '#008762', '#33ba95', '#dbf1d6',
157+
'#227839', '#0f5e7b', '#d4eef8', '#0f5e7b', '#F9C80E', ' 63.75rem', '#007656', '#c5e5e9', '#f9c80e', '#a9a9a9',
158+
'#dbdbdb', '#cccccc', '#e6e6e6', '#56b4bf', '#449098', '#77c3cb', '#22545a', '#ff7101', '#cdcdcd', '#ffffff',
159+
'd7263d', '#00a97b', '#888888', '#e6e6e6', '#f2f2f2', '#f4f4f4']);
160+
151161
const App: React.SFC<{}> = (): JSX.Element => <div style={{ padding: '20px' }}>
152162
<h3>Pie Chart</h3>
153163
<PieChart
@@ -157,6 +167,7 @@ const App: React.SFC<{}> = (): JSX.Element => <div style={{ padding: '20px' }}>
157167

158168
<h4>Donut</h4>
159169
<PieChart width={300}
170+
colorScheme={theme}
160171
backgroundColor="#eee"
161172
height={300}
162173
donutWidth={10}

examples/index.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/cosmo/bootstrap.min.css" integrity="sha384-h21C2fcDk/eFsW9sC9h0dhokq5pDinLNklTKoxIZRUn3+hvmgQSffLLQ4G4l2eEr"
88
crossorigin="anonymous">
99
</head>
10-
<style>
11-
rect {
12-
cursor: pointer;
13-
stroke-width: 2;
14-
}
15-
16-
rect.disabled {
17-
fill: transparent !important;
18-
}
19-
</style>
2010

2111
<body>
2212
<div id="root">

0 commit comments

Comments
 (0)