How to Make Charts to Visualize Your Data

After you run a query, look for the Chart button to create a chart.

Line chart

Let's look at how many questions are asked per day on StackOverflow:

select *
from `bigquery-public-data.stackoverflow.posts_questions`
where creation_date between '2020-01-01' and '2020-01-31'

line chartline chart

If we wanted to see two series, one for answered questions, and another for unanswered questions, we need an answered boolean column:

  answer_count > 0 as answered
from `bigquery-public-data.stackoverflow.posts_questions`
where creation_date between '2020-01-01' and '2020-01-31'

line chart two seriesline chart two series

Here's a video tutorial showing how to create a line chart:

Bar chart

Let's look at the top 10 most popular tags on StackOverflow and make a bar chart.

select *
from `bigquery-public-data.stackoverflow.tags`
order by count desc
limit 10

bar chartbar chart

Pie chart

Using the results from the previous pie chart example, here's what it would look like if we changed the chart type to a pie chart:

Combo Chart

Given a chart with two distinct sets of data with the same x-axis, like the data set below:


You can now create charts that have two y-axes. For example, this chart has a bars representing the number of orders on the left y-axis, and a line representing the number of ratings on the right y-axis.

combination chart showing two datasetscombination chart showing two datasets

Big Number Chart

If you just want to show a number in your chart, generally to make a dashboard more clear, you can use the big number chart. You can show your number as an average, count, maximum, minimum, or sum of your data.

Choose a column in which to trend by (we suggest a date) to see how your data is changing over a given interval.

You can also choose unsorted, ascending, or descending to help properly convey the trend you'd like to show.

Clicking on edit format will allow you to get into the weeds for your big number chart. This includes how you display the value (number, raw value, percentage, or rounded), separators, decimals shown, currency symbols, and the ability to change your trend direction and color.

Chart Colors

When creating your chart, we will automatically give each series a color from a pre-defined palette. However, you are free to customize the colors to best fit your needs. When editing the chart, you will see within the right sidebar a box next to the series that allows you to set its color. For combo charts as well as bar, line, and scatter charts when not using the group by feature, you will see the color selector next to the columns you've selected for your Y-Axis. For pie charts, as well as bar, line, and scatter when using the group by feature, there will be a new "Colors" section on that will allow you to pick a color for the automatically generated series. For big number charts, you can customize the text color of the number by entering the fomatting menu, and then inputting colors there that correspond to specific numerical conditions, such as the number being less than some value.

sidebar demonstrating colorssidebar demonstrating colors

Did this page help you?
Cookie settings