Bar charts bars in Grapher are centered on the data value tick mark associated with each bar by default. If you wish to adjust the alignment so the bars begin at the data value as seen in the image below, see the following steps.
Bars are left aligned with the tick mark label.
Bar chart created from the Vertical Bar Chart in the BarCharts.gpj samples file.
- Click the Bar chart plot in the Object Manager.
- Click Graph Tools | Worksheet | Display.
- Add a new column to your data file and populate the cell with the original X value plus the width of the bar chart using the steps below:
- Click Data Tools | Data | Transform.
- In the Transform dialog, enter the equation C = A + 1, where C is the column the data will be populated; A is the column containing the X values; and the 1 is the bar width.
- The data updates immediately when the data is opened via the Display command, however, you may want to save your worksheet using the File | Save command.
- Return the plot view and select your bar chart in the Object Manager.
- In the Property Manager, click the Plot tab.
- In the Plot Options section, expand the Width settings and change the Type to Variable.
- Set the Variable units to Axis units (interval).
- Set the X2 variable to the new x column you added to your data file. The bar chart bars will now start at the value.
Do you wish there was a built in feature to simply allow you to align the bars left, right, or center of a tick mark? Let us know and we'll add your vote!
Updated August 2019