# Creating reference lines for visualizations with visualization menu settings

You can add a reference line to several available Looker visualization types:

- [Column charts](https://docs.cloud.google.com/looker/docs/column-options#add_reference_line)
- [Bar charts](https://docs.cloud.google.com/looker/docs/bar-options#add_reference_line)
- [Line charts](https://docs.cloud.google.com/looker/docs/line-options#add_reference_line)
- [Area charts](https://docs.cloud.google.com/looker/docs/area-options#add_reference_line)
- [Scatterplot charts](https://docs.cloud.google.com/looker/docs/scatter-options#add_reference_line)


Default reference line options include static value, median, average (mean), maximum, minimum, and range, which can be selected from the visualization option settings [**Edit**](https://docs.cloud.google.com/looker/docs/line-options#value,_start_value,_and_end_value_(for_a_reference_line)) menu.


However, you may want to represent a more specific metric --- such as a weighted average --- with a reference line, instead of the default reference line options. You can make custom reference lines by creating [table calculations](https://docs.cloud.google.com/looker/docs/table-calculations#creating_table_calculations_in_looker) and then plotting them in visualizations.


Continuing with the weighted average example shown previously, let's say you wanted to weight average user age by the count of users and had measures for each of these in an Explore. To create a weighted average vertical reference line, you would perform the following steps:


1. [Add](https://docs.cloud.google.com/looker/docs/creating-and-editing-explores#adding_more_dimensions_for_more_detail) the **Users Count** measure and **Users Average Age** measures to an Explore query.
2. Create a table calculation like the following to calculate the weighted average with the two measures:

   ```
   mean(sum(${users.count}*${users.average_age})/sum(${users.count}))
   ```


   The table calculation will return a single value --- the weighted average --- for every row of the query.
3. If the selected visualization type is not a line chart, such as a column chart or bar chart, you can visualize the table calculation as a line by selecting the **Line** visualization type for the table calculation series on the [**Series**](https://docs.cloud.google.com/looker/docs/creating-visualizations#including_multiple_visualization_types_on_a_single_chart) tab of the **Edit** menu. Since the table calculation only returns one value, the line will appear as a horizontal reference line.

   <br />

   If you do not want **Users Average Age** to appear in your visualization, you can also hide that field using the [**Hide from Visualization**](https://docs.cloud.google.com/looker/docs/creating-visualizations#specifying_lookml_fields_to_include_in_the_visualization) option.

<br />


Visualized as a column chart, the **Users Count** and **Users Average Age** grouped by **Users Age** Explore data looks like the following with the **Weighted Average Age** reference line:


If you want to be able to reuse the table calculation in future Explores, you can re-create the calculation between numeric fields with a [`number`](https://docs.cloud.google.com/looker/docs/reference/param-measure-types#number) type measure.