import React from 'react';
import ReactDOM from 'react-dom';
import JqxExpander from '../../../jqwidgets-react/react_jqxexpander.js';
import JqxCheckBox from '../../../jqwidgets-react/react_jqxcheckbox.js';
import JqxRadioButton from '../../../jqwidgets-react/react_jqxradiobutton.js';
import JqxButton from '../../../jqwidgets-react/react_jqxbuttons.js';
import JqxLinearGauge from '../../../jqwidgets-react/react_jqxlineargauge.js';
class Expander extends React.Component {
render () {
return (
Options
)
}
}
class App extends React.Component {
componentDidMount(){
let container = this.refs.container.refs;
this.refs.myLinearGauge.value(50);
container.isVerticalCheckbox.on('change', (e) => {
if (e.args.checked) {
this.refs.myLinearGauge.width('100px');
this.refs.myLinearGauge.height('300px');
this.refs.myLinearGauge.orientation('vertical');
} else {
this.refs.myLinearGauge.width('300px');
this.refs.myLinearGauge.height('100px');
this.refs.myLinearGauge.orientation('horizontal');
}
});
container.showTicksCheckbox.on('change', (e) => {
if (e.args.checked) {
this.refs.myLinearGauge.ticksMajor({ visible: true, size: '10%', interval: 10 });
this.refs.myLinearGauge.ticksMinor({ visible: true, size: '5%', interval: 2.5, style: { 'stroke-width': 1, stroke: '#aaaaaa'} });
} else {
this.refs.myLinearGauge.ticksMajor({ visible: false });
this.refs.myLinearGauge.ticksMinor({ visible: false });
}
});
container.showLabelsCheckbox.on('change', (e) => {
if (e.args.checked) {
this.refs.myLinearGauge.labels({ visible: true, interval: 20 });
} else {
this.refs.myLinearGauge.labels({ visible: false });
}
});
container.showRangesCheckbox.on('change', (e) => {
if (e.args.checked) {
this.refs.myLinearGauge.showRanges(true);
} else {
this.refs.myLinearGauge.showRanges(false);
}
});
container.showBackgroundCheckbox.on('change', (e) => {
if (e.args.checked) {
this.refs.myLinearGauge.background({ visible: true });
} else {
this.refs.myLinearGauge.background({ visible: false });
}
});
container.labelsNearRadio.on('checked', () => {
this.refs.myLinearGauge.labels({ interval: 20, position: 'near' });
});
container.labelsFarRadio.on('checked', () => {
this.refs.myLinearGauge.labels({ interval: 20, position: 'far' });
});
container.labelsBothRadio.on('checked', () => {
this.refs.myLinearGauge.labels({ interval: 20, position: 'both' });
});
container.ticksNearRadio.on('checked', () => {
this.refs.myLinearGauge.ticksPosition('near');
});
container.ticksFarRadio.on('checked', () => {
this.refs.myLinearGauge.ticksPosition('far');
});
container.ticksBothRadio.on('checked', () => {
this.refs.myLinearGauge.ticksPosition('both');
});
container.showAnimationButton.on('click', () => {
this.refs.myLinearGauge.animationDuration(0);
this.refs.myLinearGauge.value(-60);
this.refs.myLinearGauge.animationDuration(1000);
this.refs.myLinearGauge.value(50);
});
}
render () {
let majorTicks = { size: '10%', interval: 10 };
let minorTicks = { size: '5%', interval: 2.5, style: { 'stroke-width': 1, stroke: '#aaaaaa'} };
let ranges =
[
{ startValue: -10, endValue: 10, style: { fill: '#FFF157', stroke: '#FFF157'} },
{ startValue: 10, endValue: 35, style: { fill: '#FFA200', stroke: '#FFA200'} },
{ startValue: 35, endValue: 60, style: { fill: '#FF4800', stroke: '#FF4800'}}
];
return (
)
}
}
ReactDOM.render(, document.getElementById('app'));