Hide some Legend Items in Line Chart - google-sheets

I have my line chart showing all the data properly, including some annotated values which are meant to act as the label in the last data point for the lines. I wanted to do it this way so that I don't have to show literally every data label for every data point.
I have everything working correctly, but I noticed I am unable to remove the annotated legend item without removing the series. By removing the series, I lose the label. Below is my chart.
As you can see, the last data points are working as labels (1092 for example). The problem is you can also see each annotated item in the legend (the colored dashes with no text next to them). How can I only show the legend items for Gained (green), Lost (red), Net (gained - lost) (yellow), and Total (blue), without the other dashes? Is this doable?
I am also open to seeing if there is another way to have only the last data point have a data label in Google Sheets. I was just working off of this tutorial.
Below is a screenshot of some of my data rows in an accompanying sheet.

as long as the annotation column is specified as 'Label' for the primary column you shouldn't be seeing the former in legend

Related

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

How to get bar chart data label to display both value and percent (of total) in google sheets?

In a 100% stacked bar chart, how can I get the data label to display BOTH the value AND the percent of total? Example: 129 (60.3%)
This is displayed in the tooltip when you hover over the bar, but not visible on the bar itself.
Example here: https://docs.google.com/spreadsheets/d/1qpro5WMBxOljwshoDFXsqC5_XFz-aF8dlfgMxdCINp4/edit#gid=796957633
Workaround
Unfortunately, at the moment of this answer it is not possible to add multiple data labels. However, you can create you own label by inserting an annotations column next to each data point. The content of these annotation columns would be your desired label. Then you would just need to add these labels as described in the reference I just shared.
In your case it would look like 129 (60.3%) which you could obtain from the following Google Sheets formula : = C4&" ("&ROUND(C4*100/($C4+$C5+$C6),1)&"%)").

Show more than 20 categories on highcharts heatmap xaxis

I am working with Highcharts heatmaps.
I have multiple data points (I am calling them functions), each having some data series defined as
The format of the above is
string, epochtime, value
The series1 or series2 (see comment below) are series names associated with each function. I want to update the series in the chart based on the click of a button associated with a function. There are multiple such functions and each function has its own button. Clicking on the button populates the respective data in the heatmap using the above array of arrays.
Th problem is when I click on adding a function which has more than 20 series defined in the format above, it doesn’t work . The screen displays time since 1970(for some reason). While it works for less than 20 series.
Figured it out, my bad. Apparently had to disable the turbothreshold for the heatmap via the plotOptions. Everything worked fine and i could have as many categories in the x axis.

Graphing Dynamic Line Graphs for ComboGraph Excel 2010

I want to create a combo chart with 2 line graphs. One of them is sourced from a pivot table in another worksheet and another is a horizontal line which may be
adjusted.(Think of equation y = 500.) How can I graph the second graph?
The circled number is horizontal graph (y = 18879.00) and it can change. How can
I graph the dynamic horizontal graph?
If you want to keep using a pivot chart, you can create a Calculated Field with the value of the line, add that to the chart and format the series as a line. With this technique, the line will not be dynamic and you will need to change the calculated field value when you want to move the line.
If you want the line to be dynamically linked to data in a cell, then you can't use a pivot chart. You'll need to create a regular chart from the pivot table data and add the line as a new data series. There are several techniques how to achieve that. The screenshot shows how the line can be plotted by having one value for the first and the last data point each. Cells H3 and H14 both point to H18, where the line value can be changed in one cell.
Add the data in H3:H14 as a new series and format as a line. If the line does not show, make sure to set the option for "Hidden and empty cells" to connect data points with line.

Editing labels of series in Google Spreadsheets

I have data listed in columns as below and by highlighting it all including the names and the units and then clicking Insert -> Diagram..., I can easily make the following graph:
The labels are correct LabelA, Labelb, and LabelC in this case.
But if the label names are not in the same column as the data, then I cannot make this graph. In the data structure below where names and data are in different columns, I again highlight all data cells as well as their units and names (by holding down the ctrl button and clicking all the cells with the cursor):
It is clear that the software does not know that it should assign the names as labels. Is there a method to make the graph show the correct labeling as in the first scenario but with the second scenario's data structure?
you could combine the data in another place with formula:
={{A1,C1,E1};{B4:B6,D4:D6,F4:F6}}
and then plot the diagram as usual.

Resources