I´ve been trying to
a.) see the value in the legend (e.g. Blue = Name A)
b.) remove the numbers (ids) at the x-axis
Can anyone guide me in the right direction / help me with this?
Thank you!
EDIT:
The initial data looks like this:
I created a pivot table that is then using SET as columns. Therefore I am not able to the option "Use first row as header".
I found the reason why the x-axis has the values on it:
EDIT 2:
Thanks for the answer!
Problem is that I can´t choose "row 2 as an option"!
(FYI: Set = Name)
Solution:
Given the table that was sent, you can generate a pivot table with this setup to prepare for graph generation:
Then generated a graph with these settings. Note that Use Row 2 as Headers and Use Column A as Labels are both checked:
The X-axis scale are automatic though, they will be adjusted based on the number of entries (and the value) in the defined X-axis.
I have the below pivot table, and i created the chart only with the data inside the table, excluding the bottom line with the totals and the right column with the grand total. If new rows automatically appear, how can I make sure they autimatically get added to the chart without having to add the bottom line as well?
best option would be to use FILTER or QUERY formula on separate sheet or hidden columns to trim down your pivoted output and feed it to chart because charts do not support advanced formulae as an input
I have a sheet with a line chart, now I'm trying to do something maybe very simple: I would like to add to this chart a vertical line using a value in a cell.
So I have this line chart
And a cell with the date 2016/01/01, I would like to have a vertical line through all the chart on the cell date
I can't figure out how to do it...
This is a copy of that sheet: https://docs.google.com/spreadsheets/d/1oeiwmeDT8pUVqBQvoE_cqk7mZxxvD5moZr41Vp4IN2I/edit?usp=sharing
I would like to show a vertical line using the "Purchase date"
I had the same problem and created a solution to overcome limitations of Google Sheets charts.
The main idea is to create an additional line in the chart, with only two points, both with the desired date. The value of the first point is 0 and the last has the maximum value of the Y axis. This way, the line always covers the entire height of the chart.
Screenshot of the Chart
Note that it is necessary to add two new values in the X axis (highlighted in blue on the sheet). Don't worry with the fact they are repeated. Google Sheets handles it correctly.
These values can be placed at the beginning of the lists. This way, it is possible to add new values at the end of them.
This solution can be viewed in: "[GoogleSheets] Dinamic Vertical Line in a Chart"
To change position of red line, just select a different value in "Purchase date" (yellow cell).
I made a merge of my first solution with the one suggested by dimo414 and created a new solution with two variations.
In the previous version of the spreadsheet, there were only two points to draw the vertical line.
In the new version, a third point were inserted to show intersection between the line and the real curve. A new column was also created, containing only a label for the new point.
The result is:
Theses changes can be seen in green background in sheets 'Dashboard_v2' and 'Dashboard_v3' of the SpreadSheet.
To determine coordinates of the new point, two approaches were used:
Search Purchase Date directly in the dataset (see sheet 'Dashboard_v2')
If the goal is to highlight only points of intersection that belong to the original dataset, it is just necessary to VLOOKUP() the date in the dataset.
Interpolate the two points immediately smaller and larger than the purchase date (see sheet 'Dashboard_v3')
Given the points [x1,y1], [x2,y2] and a value of x (where x1 <= x <= x2), its possible to find an interpolation point [x,y] with the following formula:
y=(y2-y1)*(x-x1)/(x2-x1)+y1
Although this formula is easy to implement, find the correct points to interpolate is more challenging and requires a bit of creativity.
At first, I thought of using a JS script to make things easier, but decided to use only builtin functions.
By the way, different approaches to find [x1,y1] and [x2,y2] are welcome.
To make things easier to understand, each point coordinate is determined in a different cell (see L2:M5) and the point of intersection is in L6:M7.
Of course, its possible to join all of them in just one cell, but I thought it would be harder to understand.
To close, one more detail: According to above definition, interpolation formula is valid only if (x1 <= x <= x2). Thus, both cells C2 and M6 have protections to limit the value of 'x'.
One way is to add a label to your x-axis.
For example, this is a chart that plots weight against date, with a label "Cheat Day" on 2021-07-21
For the data:
Date
Label
Weight (kg)
Weight Goal (kg)
2021-07-19
83.85
75
2021-07-20
84.55
75
2021-07-21
Cheat Day
83.8
75
2021-07-22
84.95
75
2021-07-23
83.75
75
Go to Edit the chart > Setup > Under X-axis > Click on ••• next to your "Date" column > Add labels > Select the column "Label" as your label.
Your Chart Editor > Setup should look like this:
you can have it like this, unfortunately not programmatically. the only way is to insert a line via Drawing and position it manually where needed.
spreadsheet demo
As best I can tell there isn't a way to add a vertical marker line to a chart in Google Sheets. One option that may be "good enough" in many cases is to "Add notes to a data point" and then use "Format data point" to make the point more visible. Here's an example, from your spreadsheet:
Unfortunately one limitation with this approach is you can only label a data point in the data set the chart is displaying. In your case the date you wanted to mark with a line isn't in the data set, so this won't work directly. You might be able to introduce a separate data series consisting of just that date and then add a note to that data point, but I haven't fiddled with it enough to make it work.
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.
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.