import React from 'react' import { Row, Col, Checkbox, Select, InputNumber } from 'antd' const Option = Select.Option import ColorPicker from 'components/ColorPicker' import { PIVOT_CHART_FONT_FAMILIES, PIVOT_CHART_LINE_STYLES, PIVOT_CHART_FONT_SIZES } from 'app/globalConstants' import { getCorrectInputNumber } from '../../util' const styles = require('../Workbench.less') export interface IAxisConfig { inverse: boolean showLine: boolean lineStyle: 'solid' | 'dashed' | 'dotted' lineSize: string lineColor: string showLabel: boolean labelFontFamily: string labelFontSize: string labelColor: string labelStyle: 'normal' | 'italic' | 'oblique' labelWeight: 'normal' | 'bold' | 'bolder' | 'lighter' showTitleAndUnit?: boolean nameLocation: 'start' | 'middle' | 'center' | 'end' nameRotate?: number nameGap?: number titleFontFamily?: string titleFontStyle?: string titleFontSize?: string titleColor?: string showInterval?: boolean xAxisInterval?: number xAxisRotate?: number min?: number max?: number } interface IAxisSectionProps { title: string config: IAxisConfig onChange: (prop: string, value: any) => void } export class AxisSection extends React.PureComponent { private checkboxChange = (prop) => (e) => { this.props.onChange(prop, e.target.checked) } private selectChange = (prop) => (value) => { this.props.onChange(prop, value) } private inputNumberChange = (prop) => (value) => { this.props.onChange(prop, getCorrectInputNumber(value)) } private colorChange = (prop) => (color) => { this.props.onChange(prop, color) } public render () { const { title, config } = this.props const { showLine, inverse, lineStyle, lineSize, lineColor, showLabel, labelFontFamily, labelFontSize, labelColor, labelStyle, labelWeight, showTitleAndUnit, nameLocation, nameRotate, nameGap, titleFontFamily, titleFontStyle, titleFontSize, titleColor, showInterval, xAxisInterval, xAxisRotate, min, max } = config const lineStyles = PIVOT_CHART_LINE_STYLES.map((l) => ( )) const fontFamilies = PIVOT_CHART_FONT_FAMILIES.map((f) => ( )) const fontSizes = PIVOT_CHART_FONT_SIZES.map((f) => ( )) const xAxisLabel = showTitleAndUnit === void 0 && [( 旋转角度 ), ( 刻度间隔 )] const titleAndUnit = showTitleAndUnit !== void 0 && [( 显示标题和单位 ), ( ), ( 标题位置 ), ( 标题旋转 ), ( 标题与轴线距离 ), ( 最小值 ), ( 最大值 )] return (

{title}

显示坐标轴 坐标轴反转 显示标签文字 {xAxisLabel} {titleAndUnit}
) } } export default AxisSection