PieChart.jsx 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import React from 'react';
  2. import { Card } from 'antd';
  3. import Chart from '@/components/chart';
  4. export default (props) => {
  5. const option = {
  6. // title: {
  7. // text: 'Referer of a Website',
  8. // subtext: 'Fake Data',
  9. // left: 'center'
  10. // },
  11. tooltip: {
  12. trigger: 'item'
  13. },
  14. legend: {
  15. orient: 'vertical',
  16. left: 'left'
  17. },
  18. series: [
  19. {
  20. name: 'Access From',
  21. type: 'pie',
  22. radius: '50%',
  23. data: [
  24. { value: 1048, name: 'Search Engine' },
  25. { value: 735, name: 'Direct' },
  26. { value: 580, name: 'Email' },
  27. { value: 484, name: 'Union Ads' },
  28. { value: 300, name: 'Video Ads' }
  29. ],
  30. emphasis: {
  31. itemStyle: {
  32. shadowBlur: 10,
  33. shadowOffsetX: 0,
  34. shadowColor: 'rgba(0, 0, 0, 0.5)'
  35. }
  36. }
  37. }
  38. ]
  39. };
  40. return (
  41. <Card title='Basic Pie Chart'>
  42. <Chart option={option} style={props.style}></Chart>
  43. </Card>
  44. )
  45. }