diff --git a/src/client/components/facet_bar/ChartDialog.js b/src/client/components/facet_bar/ChartDialog.js index e8477fc62a07a601b33c814c0c1fbe6710d7ca06..8ef4f3f1b899bbdc435462c1f92c70aa817d17eb 100644 --- a/src/client/components/facet_bar/ChartDialog.js +++ b/src/client/components/facet_bar/ChartDialog.js @@ -20,8 +20,12 @@ const useStyles = makeStyles(theme => ({ const ChartDialog = props => { const { fetchData, facetID, rawData, rawDataUpdateID, createChartData, facetClass, - resultClass, fetching, tooltip, title, xaxisTitle, yaxisTitle, seriesTitle + resultClass, fetching, tooltip, title, xaxisTitle, yaxisTitle, seriesTitle, lineChartConfig } = props + let xaxisType = null; let xaxisTickAmount = null; let stroke = null + if (lineChartConfig) { + ({ xaxisType, xaxisTickAmount, stroke } = lineChartConfig) + } const classes = useStyles() const [open, setOpen] = React.useState(false) @@ -65,6 +69,9 @@ const ChartDialog = props => { xaxisTitle={xaxisTitle} yaxisTitle={yaxisTitle} seriesTitle={seriesTitle} + xaxisType={xaxisType} + xaxisTickAmount={xaxisTickAmount} + stroke={stroke} /> </div> </GeneralDialog> diff --git a/src/client/components/facet_bar/FacetHeader.js b/src/client/components/facet_bar/FacetHeader.js index 83b5ec2ed31a69969f8b1a6604ec7cdced1e7fc3..811709487f4c4511bdbc3acd6ac1a858bfc3ea01 100644 --- a/src/client/components/facet_bar/FacetHeader.js +++ b/src/client/components/facet_bar/FacetHeader.js @@ -326,6 +326,7 @@ class FacetHeader extends React.Component { xaxisTitle={intl.get(`facetBar.lineChart.${this.props.facetID}.xaxisTitle`)} yaxisTitle={intl.get(`facetBar.lineChart.${this.props.facetID}.yaxisTitle`)} seriesTitle={intl.get(`facetBar.lineChart.${this.props.facetID}.seriesTitle`)} + lineChartConfig={this.props.facet.lineChartConfig} />} {menuButtons.length > 0 && <> diff --git a/src/client/reducers/sampo/perspective1Facets.js b/src/client/reducers/sampo/perspective1Facets.js index 7bc7c9eb914f006267fff06aa8c64f3895e8ca6f..bd17a4d05a1ab6c01130bb3782988490a5fc8659 100644 --- a/src/client/reducers/sampo/perspective1Facets.js +++ b/src/client/reducers/sampo/perspective1Facets.js @@ -90,6 +90,11 @@ export const INITIAL_STATE = { sortButton: false, spatialFilterButton: false, lineChartButton: true, + lineChartConfig: { + xaxisType: 'category', + xaxisTickAmount: 30, + stroke: { width: 2 } + }, isFetching: false, searchField: false, containerClass: 'four',