Files
redash/client/app/visualizations/chart/Editor/XAxisSettings.jsx
Arik Fraimovich 56d3be2248 Prettier all the Javascript code & GitHub Action (#4433)
* Prettier all the JS files

* Add GitHub Action to autoformat code pushed to master

* Fix eslint violation due to formatting.

* Remove GitHub actions for styling

* Add restyled.io config
2019-12-11 17:05:38 +02:00

48 lines
1.3 KiB
JavaScript

import React from "react";
import { Section, Switch } from "@/components/visualizations/editor";
import { EditorPropTypes } from "@/visualizations";
import AxisSettings from "./AxisSettings";
export default function XAxisSettings({ options, onOptionsChange }) {
return (
<React.Fragment>
<AxisSettings
id="XAxis"
features={{ autoDetectType: true }}
options={options.xAxis}
onChange={xAxis => onOptionsChange({ xAxis })}
/>
<Section>
<Switch
data-test="Chart.XAxis.Sort"
defaultChecked={options.sortX}
onChange={sortX => onOptionsChange({ sortX })}>
Sort Values
</Switch>
</Section>
<Section>
<Switch
data-test="Chart.XAxis.Reverse"
defaultChecked={options.reverseX}
onChange={reverseX => onOptionsChange({ reverseX })}>
Reverse Order
</Switch>
</Section>
<Section>
<Switch
data-test="Chart.XAxis.ShowLabels"
defaultChecked={options.xAxis.labels.enabled}
onChange={enabled => onOptionsChange({ xAxis: { labels: { enabled } } })}>
Show Labels
</Switch>
</Section>
</React.Fragment>
);
}
XAxisSettings.propTypes = EditorPropTypes;