Create a Chart on Google Sheets with Lines - Complicated - google-sheets

I am trying to check if it is possible to add lines to a chart that will show differences of data. The data that I have contains negative numbers and negative percentages and I wanted to add a line that will show the percentage ; previous month minus running month volume.
Here is a screenshot of the table and chart that I currently have:
I've tried experimenting with different charts, and arrangements of data, but it yielded no successful results. I've tried searching all through many forums and have not found anyone who has a similar question as I do. I wanted the chart to show the following:
What I want for the chart to look like:

Related

Highchart Scatter Series must appear in front of the column series, but if it contains more than 5k records, it appears at the back of column series

Chart as three columns series with stacking on top and one scatter series with over 5k records. So, in the front view, we need to see the scatter first, followed by the subsequent column series. It works perfectly with less than 5k records, but if there are more than 5k, the columns chart falls back.
Demo
Expecting Series must appear in front of the column series
For large amounts of data you can use Highcharts Boost module, add to this script to your project:
<script src="https://code.highcharts.com/modules/boost.js"></script>
Blog article explain how to work with boost module:
https://www.highcharts.com/docs/advanced-chart-features/boost-module

Google Sheets Chart Axis Title does not update when source cell is formula

I want the Google Sheets chart x-axis title to change when the data in a chart changes. I've made a simple example to demonstrate the problem. In the following animated gif (click to see greater detail) the x-axis title does not update when the data in the scatter chart changes.
Apparently this happens because the source cell for that title (A1) is itself a formula (to give the average of the x-values -- in my real-world example, it's more complicated than that).
The only way I know to fix this is to delete the chart and make a new one, as shown in the last part of the animation. But with my real-world example, this is a lot more troublesome.
Thanks for any help.
I have been running a couple of tests and have some experience on how the charts are created under Sheets in comparison to the ones in Excel.
There have been multiple forums discussing this particular issue, the main issue with it is the fact that this portion of the Chart is only a title text and does not linked to any portion to the table or that you cannot select a custom formula to be used for updates. It is also mentioned over the official documentation that you can only manual edit this titles.
As an alternative, you could implement a script so it changes the chart title for the average.
function onOpen(){
SpreadsheetApp.getUi().createMenu('Charts').addItem('Update title of the first chart from active cell', 'myFunction').addToUi();
}
function myFunction() {
var sheet = SpreadsheetApp.getActiveSheet();
var chart = sheet.getCharts()[0];
chart = chart.modify()
.setOption('title', sheet.getActiveCell().getValue() || 'Empty')
.build();
sheet.updateChart(chart);
}
The portion of this code has been found and discussed over this thread.
I also believe that it should be a feature directly on Sheets and it should be implemented in the future, you can send feedback from the help option or go to the Feature ideas portal:
https://www.googlecloudcommunity.com/gc/Feature-Ideas/cmp-p/grouphub:workspace-ideas-group

Google Sheets: How to make a stacked/aggregate chart

I have made a bar chart which aggregates my data, but is there any way I can split each bar based on the data it is aggregating - similar to how a stacked bar chart would look?
Here is a bad artists impression (thick blue lines mine). The idea is that it's important to know from looking at the graph if I sold 5 at £1, or 1 at £5.
Ideally this would work even if the price for each item is variable, but that is not essential (eg: if there is a 'hack' with hardcoding Apple = 3, I can live with that.)
I'm also fine inputting helper columns etc, within reason, but I would want to be able to easily continue to add things to the list on the left without having to add new helper columns each time (calculated ones are fine, of course.)
Thanks in advance.
UPDATE: With thanks to Kin Siang below, I ended up implementing a slightly modified version of their solution, which I am posting here for completeness.
I added a very large (but finite) number of helper columns to the right, with a formula in each cell which would look for the nth occurrence of the item in the main list (wrapped in an iferror to make the unused cells blank).
=iferror(index(FILTER($A:$B,$A:$A=$D2),E$1,2))
Theoretically it could run out of space one day, but I have made it suitably large that this should not be an issue. It has the advantage over the other solution that I do not need to sort or otherwise manipulate the input range and can continue trickling in data to the main list and have the chart automatically update.
Yes, it is possible to display the chart in your case, however need some data transpose in order to do so, let me show you the example with dataset
Assuming this is your original data:
First sort the data by alphabet, and enter this formula in new column
=if(G39="",1,if(G40=G39,I39+1,if(G40<>G39,1)))
Next add new column for categorical purpose, by using concatenate function
="Price"&I40
In the transform data for chart purpose, enter this formula to split all price into different row, different column for different product
=sumifs($H$40:$H$47,$G$40:$G$47,$A41,$J$40:$J$47,B$40)
After that i select stack bar chart and ensure the price in under series, in case in 23 will have some problem to set price at series correctly, you can use 33 data create stack bar chart and update the data range again, it will work also
Here is the cute chart you expected, accept if help :)
*When certain fruit has less price record, it is advised to fill in 0, as the data table need in same column (see the orange price 3), although I didnot test if blank

Google Sheets: Swap X and Y Axis in Chart

I am trying to illustrate the twist in a sail using a chart, showing the effect of various twist amounts.
However, try as I might, I cannot swap the x and y axis! The cells B3:B8 are the height going up the sail, where the measurements were taken, and should be the y-axis.
The columns C:V are series, which are different sets of measurements taken at the various heights up the sail, with the degree of twist as the series' values. This is what I have:
I've also tried to create the chart from Transpose()d data (swapped rows <-> cols) but ended up with the same chart! The "Height" is supposed to be the Y-axis, and the values ("Degrees") the X-axis.
I must be missing something obvious, but Google is not my friend today. I have created a sample Spreadsheet here if anyone can help. MTIA.
Currently it is not possible to define the Y-Axis to a specific range for Smooth Line Chart, in fact, the only way this can be defined is by using Bar Chart.
As a workaround, you can use Bar Chart to define the Y-Axis like this:
Please note that it only looks best when displaying one or two series, the bars would look squished when more series are added.
As for the original intention of defining Y-axis for Line Charts, or a completely new type of chart, you can file a feature idea request here:
How To Submit a Feature Idea Request
Google Workspace Feature Idea Request Link

Total and percentage for each column in a line and stacked column chart

I need to show in one single bar chart the number of elements of each column and also its percentage regarding the total.
With a Line and stacked columns chart, I reach this:
However, the tooltip option, on the line, shows me only one value, and I need to get both of them. I mean, not only that 32 but also the percentage corresponding to that value.
Is there a way to get this? maybe another chart?
OK. I understand the question now. Unfortunately, this isn't currently possible.
From Microsoft Community Support,
This is an expected behavior. The tooltips only show when you hover over a column data point in combo chart.
This has been submitted as an idea for Microsoft to address. Please vote and/or comment here:
Combo Charts: How to add tooltip on line

Resources