# visualizer/3.11.3/classes/Visualizer/Gutenberg/src/Components/Sidebar/TimelineSettings.js

Visualizer – Tables &amp; Charts Manager with Built-in AI Generator, version 3.11.3. 102 lines.

- Page: https://pluginprobe.com/plugins/visualizer/3.11.3/code/classes/Visualizer/Gutenberg/src/Components/Sidebar/TimelineSettings.js
- Raw: https://pluginprobe.com/plugins/visualizer/3.11.3/raw/classes/Visualizer/Gutenberg/src/Components/Sidebar/TimelineSettings.js
- Modified: 2020-02-13T13:37:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/visualizer/3.11.3/code/classes/Visualizer/Gutenberg/src/Components/Sidebar/TimelineSettings.js#L10-L20`.

```javascript
/**
 * WordPress dependencies
 */
const { __ } = wp.i18n;

const { Component } = wp.element;

const { ColorPalette } = wp.blockEditor || wp.editor;

const {
	BaseControl,
	CheckboxControl,
	PanelBody
} = wp.components;

class TimelineSettings extends Component {
	constructor() {
		super( ...arguments );

		this.mapValues = this.mapValues.bind( this );
	}

	mapValues( settings, objName ) {
		if ( settings.timeline === undefined ) {
			return settings[ objName ];
		}
		return settings.timeline[ objName ];
	}

	render() {

		const settings = this.props.chart['visualizer-settings'];
		this.mapValues( settings, 'showRowLabels' );

		return (
			<PanelBody
				title={ __( 'Timeline Settings' ) }
				initialOpen={ false }
				className="visualizer-advanced-panel"
			>

				<CheckboxControl
					label={ __( 'Show Row Label' ) }
					help={ __( 'If checked, shows the category/row label.' ) }
					checked={ Number( this.mapValues( settings, 'showRowLabels' ) ) }
					onChange={ e => {
						if ( settings.timeline === undefined ) {
							settings.timeline = {};
						}
						settings.timeline.showRowLabels = ! Number( this.mapValues( settings, 'showRowLabels' ) );
						this.props.edit( settings );
					} }
				/>

				<CheckboxControl
					label={ __( 'Group by Row Label' ) }
					help={ __( 'If checked, groups the bars on the basis of the category/row label.' ) }
					checked={ Number( this.mapValues( settings, 'groupByRowLabel' ) ) }
					onChange={ e => {
						if ( settings.timeline === undefined ) {
							settings.timeline = {};
						}
						settings.timeline.groupByRowLabel = ! Number( this.mapValues( settings, 'groupByRowLabel' ) );
						this.props.edit( settings );
					} }
				/>

				<CheckboxControl
					label={ __( 'Color by Row Label' ) }
					help={ __( 'If checked, colors every bar on the row the same.' ) }
					checked={ Number( this.mapValues( settings, 'colorByRowLabel' ) ) }
					onChange={ e => {
						if ( settings.timeline === undefined ) {
							settings.timeline = {};
						}
						settings.timeline.colorByRowLabel = ! Number( this.mapValues( settings, 'colorByRowLabel' ) );
						this.props.edit( settings );
					} }
				/>

				<BaseControl
					label={ __( 'Single Color' ) }
				>
					<ColorPalette
						value={ this.mapValues( settings, 'singleColor' ) }
						onChange={ e => {
							if ( settings.timeline === undefined ) {
								settings.timeline = {};
							}
							settings.timeline.singleColor = e;
							this.props.edit( settings );
						} }
					/>
				</BaseControl>

			</PanelBody>
		);
	}
}

export default TimelineSettings;

```
