Add Data Bars UI in SharePoint List Column Formatting in SharePoint List

Introduction

In our previous article, we explored how to format the current list view in SharePoint, enhancing the visual appeal and user experience. In this article, we will take the formatting to the next level by diving into Data Bars—a powerful feature in SharePoint column formatting. Data bars allow you to visualize numerical data directly in your list columns, offering a quick and intuitive way to understand data distribution and trends. We will cover the steps required to add data bars to your SharePoint list columns and customize them according to your needs.

Adding data bars can be particularly useful for highlighting progress, sales figures, or any numerical data, where a visual representation helps users interpret the information more easily.

Features of Data Bars in SharePoint Column Formatting

  • Visual Representation: Data bars offer a graphical representation of numeric values within your SharePoint list columns, making data more digestible and easy to interpret.
  • Dynamic Range Customization: You can adjust the minimum and maximum values for the data bars, allowing the scale of the bars to align with your data range.
  • Custom Color Options: Customize the color of the data bars to match your organization's branding or to highlight key data points.
  • Advanced JSON Customization: For users familiar with JSON, you can add advanced customization to the data bars to create tailored views for specific use cases.

Steps to Add Data Bars in SharePoint List Column Formatting

Let’s walk through the process of adding data bars to a SharePoint list column step by step. This guide assumes that you are working with a Number column (as data bars are only applicable to numeric values).

Number column

Step 1. Login to SharePoint.

  1. Open your browser and go to your SharePoint site URL.
  2. Enter your login credentials to access the SharePoint environment where your list is located.

Step 2. Open the SharePoint Site and List.

Settings

  1. Once logged in, navigate to the SharePoint site where the list is located.
  2. In the left-hand navigation panel, select Site Contents to view all the content available on the site.
    Site Contents
  3. Find and click on the list to which you want to apply the data bars. Ensure that this list contains a Number type column, as data bars only work with numeric values.

Step 3. Open the List View and Select the Column.

 List View

Format columns

  1. After opening the list, select the current view in which you want to apply the data bars.
  2. Click on the View options at the top right of the list (usually under the settings gear icon).
  3. Choose Format's current view to start editing the list view formatting.

Step 4. Select and Apply Data Bar Formatting.

Data Bar Formatting

  1. Once you're in the formatting options, click on Format columns.
    Formatting options
  2. Now, you'll see a list of all columns in the view. Select the numeric column where you want to add data bars.
    Numeric column
  3. In the formatting options that appear, click on the Data bar option.

Step 5. Customize the Data Bar Settings.

Data bar option

  1. Minimum and Maximum Values.
    Maximum Values
  2. Set the minimum and maximum values for the data bars. For example, if you have sales data ranging from 0 to 1000, set the minimum to 0 and the maximum to 1000 to scale the bars proportionally.
  3. Bar Color: You can customize the color of the data bars by choosing from a color palette or entering a hex color code. This allows you to match the data bars with your corporate theme or highlight specific ranges.
  4. Advanced Mode
    Advanced Mode
  5. If you want even more control, switch to Advanced Mode to enter custom JSON formatting. This allows you to tailor the data bars even further, such as setting dynamic colors based on values or applying custom styles to different ranges of data.

Here’s a sample JSON you can use in Advanced Mode to customize the color of the data bars based on specific value ranges.

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "type": "Bar",
  "barColor": "rgba(0, 128, 0, 0.6)",
  "min": 0,
  "max": 100,
  "value": "[$YourColumnName]"
}
Step 6. Preview and Save the Changes.
  1. After making the necessary adjustments, click on the Preview button to see how the data bars will appear in your SharePoint list.
  2. If everything looks good, click Save to apply the data bars formatting to the selected column.

Additional Tips

  1. Conditional Formatting: You can use conditional formatting within your JSON code to create dynamic changes in the data bars based on specific values. For example, change the color of the data bar if the value exceeds a certain threshold.
  2. Data Bar Range: Be mindful of setting the correct minimum and maximum values. If your data varies significantly, it’s essential to adjust the range accordingly to ensure the data bars reflect the true scale of the data.

Data Bar Range

Conclusion

In this article, we have explored how to add and customize Data Bars in SharePoint column formatting, helping you to visually represent numerical data in your SharePoint lists. Data bars are a simple yet effective tool for creating visually appealing and insightful views for your list of items. In the next article, we will dive deeper into more advanced column formatting options, including custom JSON formatting and applying different types of formatting to other column types.

Stay tuned for more!