import * as React from 'react'; import JqxBulletChart, { IBulletChartProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbulletchart'; import JqxCheckBox, { ICheckBoxProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxcheckbox'; import JqxDropDownList, { IDropDownListProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxdropdownlist'; import JqxExpander from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxexpander'; import JqxRadioButton, { IRadioButtonProps } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxradiobutton'; import JqxSlider from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxslider'; export interface IState extends IBulletChartProps { source: IDropDownListProps["source"]; showLabelsChecked: ICheckBoxProps["checked"]; enableAnimationChecked: ICheckBoxProps["checked"]; disabledChecked: ICheckBoxProps["checked"]; rtlChecked: ICheckBoxProps["checked"]; nearRadioChecked: IRadioButtonProps["checked"]; farRadioChecked: IRadioButtonProps["checked"]; bothRadioChecked: IRadioButtonProps["checked"]; currencyRadioChecked: IRadioButtonProps["checked"]; percentRadioChecked: IRadioButtonProps["checked"]; noneRadioChecked: IRadioButtonProps["checked"]; pointerDropDownSelected: IDropDownListProps["selectedIndex"]; targetDropDownSelected: IDropDownListProps["selectedIndex"]; } class App extends React.PureComponent<{}, IState> { private myBulletChart = React.createRef(); private showLabelsCheckbox = React.createRef(); private disabledCheckbox = React.createRef(); private rtlCheckbox = React.createRef(); private enableAnimationCheckbox = React.createRef(); private nearRadio = React.createRef(); private farRadio = React.createRef(); private bothRadio = React.createRef(); private currencyRadio = React.createRef(); private percentRadio = React.createRef(); private noneRadio = React.createRef(); private valueSlider = React.createRef(); private pointerDropDownList = React.createRef(); private targetDropDownList = React.createRef(); constructor(props: {}) { super(props); this.showLabelsCheckboxChange = this.showLabelsCheckboxChange.bind(this); this.nearRadioChecked = this.nearRadioChecked.bind(this); this.farRadioChecked = this.farRadioChecked.bind(this); this.bothRadioChecked = this.bothRadioChecked.bind(this); this.currencyRadioChecked = this.currencyRadioChecked.bind(this); this.percentRadioChecked = this.percentRadioChecked.bind(this); this.noneRadioChecked = this.noneRadioChecked.bind(this); this.enableAnimationCheckboxChange = this.enableAnimationCheckboxChange.bind(this); this.valueSliderChange = this.valueSliderChange.bind(this); this.pointerDropDownListChange = this.pointerDropDownListChange.bind(this); this.targetDropDownListChange = this.targetDropDownListChange.bind(this); this.disabledCheckboxChange = this.disabledCheckboxChange.bind(this); this.rtlCheckboxChange = this.rtlCheckboxChange.bind(this); this.state = { animationDuration: 0, bothRadioChecked: true, currencyRadioChecked: true, disabled: false, disabledChecked: false, enableAnimationChecked: false, farRadioChecked: false, labelsFormat: 'c', nearRadioChecked: false, noneRadioChecked: false, percentRadioChecked: false, pointer: { label: 'Revenue 2019 YTD', size: '25%', value: 270 }, pointerDropDownSelected: 4, ranges: [ { color: '#000000', endValue: 200, opacity: 0.5, startValue: 0 }, { color: '#000000', endValue: 250, opacity: 0.3, startValue: 200 }, { color: '#000000', endValue: 300, opacity: 0.1, startValue: 250 } ], rtl: false, rtlChecked: false, showLabelsChecked: true, source: ['Black', 'Red', 'Green', 'Blue', 'From theme'], target: { label: 'Revenue 2018 YTD', size: 4, value: 260 }, targetDropDownSelected: 4, ticks: { interval: 50, position: 'both', size: 10 } } }; public render() { return (
JqxBulletChart Settings
Show Labels
  • Near
  • Far
  • Both

Labels Format:
  • Currency
  • Percent
  • None

Enable Animation
Pointer Value:

Pointer Color:

Target Color:

Disabled Right-to-Left
); } private showLabelsCheckboxChange(event: any): void { const checked = event.args.checked; if (checked) { this.nearRadio.current!.enable(); this.farRadio.current!.enable(); this.bothRadio.current!.enable(); this.currencyRadio.current!.enable(); this.percentRadio.current!.enable(); this.noneRadio.current!.enable(); if (this.nearRadio.current!.props.checked) { this.setState({ ticks: { position: 'near' } }); } else if (this.farRadio.current!.props.checked) { this.setState({ ticks: { position: 'far' } }); } else { this.setState({ ticks: { position: 'both' } }); } this.setState({ showLabelsChecked: true }); } else { this.setState({ showLabelsChecked: false, ticks: { position: 'none' } }); this.nearRadio.current!.disable(); this.farRadio.current!.disable(); this.bothRadio.current!.disable(); this.currencyRadio.current!.disable(); this.percentRadio.current!.disable(); this.noneRadio.current!.disable(); } }; private nearRadioChecked(): void { if (!this.state.nearRadioChecked) { this.setState({ bothRadioChecked: false, farRadioChecked: false, nearRadioChecked: true, ticks: { position: 'near' } }); } }; private farRadioChecked(): void { if (!this.state.farRadioChecked) { this.setState({ bothRadioChecked: false, farRadioChecked: true, nearRadioChecked: false, ticks: { position: 'far' } }); } }; private bothRadioChecked(): void { if (!this.state.bothRadioChecked) { this.setState({ bothRadioChecked: true, farRadioChecked: false, nearRadioChecked: false, ticks: { position: 'both' } }); } }; private currencyRadioChecked(): void { if (!this.state.currencyRadioChecked) { this.setState({ currencyRadioChecked: true, labelsFormat: 'c', noneRadioChecked: false, percentRadioChecked: false }); } }; private percentRadioChecked(): void { if (!this.state.percentRadioChecked) { this.setState({ currencyRadioChecked: false, labelsFormat: 'p', noneRadioChecked: false, percentRadioChecked: true, }); } }; private noneRadioChecked(): void { if (!this.state.noneRadioChecked) { this.setState({ currencyRadioChecked: false, labelsFormat: 'null', noneRadioChecked: true, percentRadioChecked: false, }); } }; private enableAnimationCheckboxChange(event: any): void { const checked = event.args.checked; if (checked) { this.setState({ animationDuration: 400, enableAnimationChecked: true }); } else { this.setState({ animationDuration: 0, enableAnimationChecked: false }); } }; private valueSliderChange(event: any): void { const value = event.args.value; this.myBulletChart.current!.val(value); }; private pointerDropDownListChange(event: any): void { if (event.args.index !== this.state.pointerDropDownSelected) { const choice = event.args.item.label; let newColor; if (choice !== 'From theme') { newColor = choice; } else { newColor = ''; } this.setState({ pointer: { color: newColor }, pointerDropDownSelected: event.args.index }); } }; private targetDropDownListChange(event: any): void { if (event.args.index !== this.state.targetDropDownSelected) { const choice = event.args.item.label; let newColor; if (choice !== 'From theme') { newColor = choice; } else { newColor = ''; } this.setState({ target: { color: newColor }, targetDropDownSelected: event.args.index }); } }; private disabledCheckboxChange(event: any): void { const checked = event.args.checked; if (checked) { this.setState({ disabled: true, disabledChecked: true }); } else { this.setState({ disabled: false, disabledChecked: false }); } }; private rtlCheckboxChange(event: any): void { const checked = event.args.checked; if (checked) { this.setState({ rtl: true, rtlChecked: true }); } else { this.setState({ rtl: false, rtlChecked: false }); } }; } export default App;