Skip to content

Commit

Permalink
Add the missing donut chart example
Browse files Browse the repository at this point in the history
Added the missing donut chart example. This PR fixes #83
  • Loading branch information
bulyonov committed Sep 2, 2016
1 parent 4c72518 commit bdf0b67
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/example/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import TreemapExample from './treemap/dynamic-treemap';
import StaticTable from './table/static-table';
import DynamicTable from './table/dynamic-table';
import SimpleRadialChart from './radial-chart/simple-radial-chart';
import DonutChartExample from './radial-chart/donut-chart';
import CustomRadiusRadialChart from './radial-chart/custom-radius-radial-chart';
import VerticalDiscreteColorLegendExample from './legends/vertical-discrete-color';
import HorizontalDiscreteColorLegendExample from './legends/horizontal-discrete-color';
Expand Down Expand Up @@ -153,7 +154,10 @@ const examples = (
<h3>Simple Radial Chart</h3>
<SimpleRadialChart />
</section>

<section>
<h3>Simple Donut Chart</h3>
<DonutChartExample />
</section>
<section>
<h3>Custom Radius</h3>
<CustomRadiusRadialChart />
Expand Down
39 changes: 39 additions & 0 deletions src/example/radial-chart/donut-chart.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (c) 2016 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import React from 'react';
import {RadialChart} from '../../';

export default function DonutChartExample() {
return (
<RadialChart
innerRadius={100}
radius={140}
data={[
{angle: 2},
{angle: 6},
{angle: 2},
{angle: 3},
{angle: 1}
]}
width={300}
height={300}/>
);
}

0 comments on commit bdf0b67

Please sign in to comment.