Welcome to new things

[Technical] [Electronic work] [Gadget] [Game] memo writing

How to center a Tableau bar chart on a date

When displaying a bar chart in Tableau with continuous date values, it is difficult to see the bar chart because the starting position of the bar chart is to the left.

In particular, when displayed with a line graph in a two-axis display, the line graph is the center of the date, but the bar graph is off, making it even more difficult to see.

How to center a Tableau bar chart on a date

The center of the bar graph can be centered on the center of the date by setting the graph's [Size]-[Fixed]-[Alignment] to center.

However, sometimes [Size]-[Fixed]-[Placement] is grayed out and cannot be selected.

How to center a Tableau bar chart on a date

The following article describes how to deal with such cases, and we have included a transcription of the procedure and some additional explanations.

Tableau Community Forums

procedure

Create a date with "DATETRUNC" that has the same value as the date interval on the graph.

Example: In the case of daily graphs

How to center a Tableau bar chart on a date

Drop created date in column

Set dropped date to [exact date

How to center a Tableau bar chart on a date

Then [Size]-[Fixed]-[Placement] will be ungrayed out and can be changed.

Set [Size]-[Fixed]-[Alignment] of bar chart to "Center

How to center a Tableau bar chart on a date

The center of the bar graph will then be at the date position.

How to center a Tableau bar chart on a date

However, sometimes when the date formatting is changed, it becomes misaligned.

How to center a Tableau bar chart on a date

This is happening because the center value of the date has shifted from the value created by "DATETRUNC". So, changing the center value so that it is the same as the "DATETRUNC" in the following will fix the problem.

In [Edit Axis] - [Scale] - [Large Scale], set the scale to "Fixed" and the "scale origin" to the same as the result of "DATETRUNC".

Example: If you set the date as a daily, "DATETRUNC" will be at 0:00, so the origin should also be at 0:00.

How to center a Tableau bar chart on a date

Then, in a nice touch, a bar graph appears in the center of the date.

How to center a Tableau bar chart on a date

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com