DoubleYAxis.tsx 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import React from 'react'
  2. import { Row, Col, Checkbox } from 'antd'
  3. import { onSectionChange } from './util'
  4. import { ISpecConfig } from '../types'
  5. import styles from '../../../Workbench.less'
  6. interface ISpecSectionDoubleYAxisProps {
  7. spec: ISpecConfig
  8. title: string
  9. onChange: (value: string | number, propPath: string | string[]) => void
  10. }
  11. function SpecSectionDoubleYAxis (props: ISpecSectionDoubleYAxisProps) {
  12. const { spec, title, onChange } = props
  13. const { smooth, step, symbol, label, stack } = spec
  14. return (
  15. <div className={styles.paneBlock}>
  16. <h4>{title}</h4>
  17. <div className={styles.blockBody}>
  18. <Row gutter={8} type="flex" align="middle" className={styles.blockRow}>
  19. <Col span={10}>
  20. <Checkbox checked={smooth} onChange={onSectionChange(onChange, 'smooth')}>
  21. 平滑
  22. </Checkbox>
  23. </Col>
  24. <Col span={10}>
  25. <Checkbox checked={step} onChange={onSectionChange(onChange, 'step')}>
  26. 阶梯
  27. </Checkbox>
  28. </Col>
  29. </Row>
  30. <Row gutter={8} type="flex" align="middle" className={styles.blockRow}>
  31. <Col span={10}>
  32. <Checkbox checked={symbol} onChange={onSectionChange(onChange, 'symbol')}>
  33. 节点标记
  34. </Checkbox>
  35. </Col>
  36. {/* <Col span={7}>
  37. <Checkbox
  38. checked={stack}
  39. onChange={onSectionChange(onChange, 'stack')}
  40. >
  41. 堆叠
  42. </Checkbox>
  43. </Col> */}
  44. <Col span={10}>
  45. <Checkbox checked={label} onChange={onSectionChange(onChange, 'label')}>
  46. 数值
  47. </Checkbox>
  48. </Col>
  49. </Row>
  50. <Row gutter={8} type="flex" align="middle" className={styles.blockRow}>
  51. <Col span={10}>
  52. <Checkbox checked={stack} onChange={onSectionChange(onChange, 'stack')}>
  53. 堆叠
  54. </Checkbox>
  55. </Col>
  56. </Row>
  57. </div>
  58. </div>
  59. )
  60. }
  61. export default SpecSectionDoubleYAxis