In Google Sheets, I need two sets to data to appear on the same chart. One needs to be a scatter charts and the other needs to be a line chart. Both sets of data have the same x and y axis data / range. I just need to show both in a single chart using different chart types. How can this be done in Google Sheets?
2 Answers
Google does not have a feature to do what you want. However, a work-around may be possible by making the line transparent.
This is untested.
- Create two graphs
- Edit the Line graph to remove the background colour (Customize, Chart Style, Background color=none)
- Drag one graph to physically overlay on the other.
- Format each graph according to requirements.
-
This is a kludge, but a good one! To get the graphs to line up I had to make sure the axes min/max, title, labels, formatting, etc. were consistent between the stacked graphs.– yoyoCommented Mar 25 at 19:17
I just discovered a much better work-around: Use a line chart, and for the series you want to display as scatterplot, set the line width to zero.
For this to work, however, the data sets must share a single column for the x-axis but have separate columns for each y series. Assuming your data is not already structured that way, you can combine data sets like this (using e.g. QUERY
or ARRAYFORMULA
if you don't want to move the data):
A | B | C |
---|---|---|
[x1 for line] | [y1 for line] | |
[x2 for line] | [y2 for line] | |
... | ... | |
[x1 for scatter] | [y1 for scatter] | |
[x2 for scatter] | [y2 for scatter] | |
... | ... |
When setting up the chart, make sure you don't exclude the blank sections from the data range—the chart will ignore the blanks, but they need to be present so the rows line up properly with their corresponding data.