import React from 'react' import { Row, Col, Checkbox, Select } from 'antd' const Option = Select.Option import ColorPicker from 'components/ColorPicker' import { PIVOT_CHART_FONT_FAMILIES, PIVOT_CHART_LINE_STYLES, PIVOT_CHART_FONT_SIZES, CHART_LEGEND_POSITIONS, CHART_LEGEND_TYPE } from 'app/globalConstants' const styles = require('../Workbench.less') export interface ILegendConfig { showLegend: boolean legendPosition: string legendType?: string selectAll: boolean fontFamily: string fontSize: string color: string } interface ILegendSectionProps { title: string config: ILegendConfig onChange: (prop: string, value: any) => void } export class LegendSection extends React.PureComponent< ILegendSectionProps, {} > { private checkboxChange = (prop) => (e) => { this.props.onChange(prop, e.target.checked) } private selectChange = (prop) => (value) => { this.props.onChange(prop, value) } private colorChange = (prop) => (color) => { this.props.onChange(prop, color) } public render() { const { title, config } = this.props const { showLegend, legendPosition, legendType, selectAll, fontFamily, fontSize, color } = config const positions = CHART_LEGEND_POSITIONS.map((p) => ( )) const types = CHART_LEGEND_TYPE.map((p) => ( )) const fontFamilies = PIVOT_CHART_FONT_FAMILIES.map((f) => ( )) const fontSizes = PIVOT_CHART_FONT_SIZES.map((f) => ( )) return (