Highstock and null values - highcharts

I have a linear chart with null values as you can see in the first link.
For example my value for the 18th may is calculated between the 18 and the 19.
`http://jsfiddle.net/29WKr/2/`
For the 20th I've a NULL value but I'd like to have a line between the 19 and the 20 like the second picture. I don't want a value for the 20th (I could put the same value as the 19 and have my line but in that case we don't see there is a hole) like here:
`http://jsfiddle.net/29WKr/3/`
In fact I need something like the second chart but with keeping the null value and have a line.
Thanks a lot,

Set connectNulls: true see: http://jsfiddle.net/Fusher/29WKr/4/ .

Related

Google Sheet Sparkline for every nth column

I would like to add a Sparkline to a sheet showing the evolution of a value.
My table looks like this
value #1
diff former value
value #2
diff former value
value #3
diff former value
Sparkline here
Sparkline here
Sparkline here
10
0
8
-2
9
1
My naive guess for the "Sparkline here" cell was (e.g. for C2)
=SPARKLINE($A3:c3)
and for instance for E2
=SPARKLINE($A3:e2)
unfortunately this takes the 0 (B3) and -2 (D2) into account.
Question: How can I create a sparkline that would only take every second value into account, i.e. 10, 8, 9.
Best if this could be done without adding a helper row/column somewhere else.
Try
=sparkline(filter(A3:F3, isodd(column(A3:F3))))
or, depending on your locale
=sparkline(filter(A3:F3; isodd(column(A3:F3))))
This will include only the 'odd' columns in the specified range.

google sheets (h)lookup last non-null value in specific column

I'm trying to populate a column with the last known price at the end of a batch of orders.
Please see an example attached.
I need the last price known from columns "price". Please note that there is not always value.
I tried something like this : =LOOKUP(B2:H2,"price",B3:H3<>"")
But it didn't really work.
(the nos 18 and 3 in column "I" are just examples. I need the green 3 results),thx.
Maybe try:
=INDEX(FILTER(B3:H3,B$2:H$2="price"),COUNTIFS(B$2:H$2,"price",B3:H3,"<>"))
If there could be empty gaps in your data, try this alternative:
=INDEX(A3:H3,MAX(COLUMN(A3:H3)*(A$2:H$2="price")*(A3:H3<>"")))

Removing lines between two values in Highchart's line chart

I have an ordinary line chart filled with weekly data from a table. Some weeks have no data but these instances are not marked with null or 0.
The table can look something like this:
201734 45
201735 63
201738 68
201739 53
201740 76
So have this:
As you can see it's impossible to see that there are missing weeks between week 35 and 38.
I want it to look like this:
where the line between two values have been erased when the difference between two weeks are not 1: 201738 - 201735 != 1
My code looks similar to: https://jsfiddle.net/eumLdkjb/1/
Any ideas on how to do this?
Thanks!
Create categotries array inside xAxis with missing names along with the breaks.
API Reference:
http://api.highcharts.com/highcharts/xAxis.categories
http://api.highcharts.com/highcharts/xAxis.breaks
Example:
https://jsfiddle.net/1nz4kcum/
You have to create array in a such a way that, y axis value will be null, for example current case:
['201736', null],['201737', null]
https://jsfiddle.net/vsj5jmnz/

How do you set a filter view in Google Sheet that filters the last 24 hours of data?

I have a data logging program that creates rows of data every 10 minutes. This is displayed in a chart.
The first column is a timestamp, with date and time. I want to only display the last 24 hours of data in my chart, so thought that a filter view would do the trick. I selected the column and chose "Filter by condition" and "Greater than or equal to", with "Now() -1" as the value. I tried various other combinations but nothing seems to work. Any ideas?
Your approach is correct: use the filter view
Filter by condition -> Greater than or equal to -> =now()-1
A common mistake is to omit =, possibly this is the reason it didn't work for you.
A similar-sounding "date is after" condition would not be appropriate here, as it ignores the time part of the date.

Getting Corresponding Cell In Google Sheets?

I have a Google sheet for tracking my weight. I have two columns: Date and Weight. While the goal is to have the weight column sorted in descending order, that doesn't always happen in reality...
The data essentially looks like this (weights changed to far lower values, of course):
Date |Weight
04/01/10|195
04/02/10|194
04/03/10|190
04/04/10|198
etc.
Anyway, I have a cell in another spot on the sheet that shows the minimum value from the weight column using this formula
=(Min(B:B))
What I would like to do is display the corresponding date cell for whatever the minimum value from the weight column is. So, with this dataset, I want to show 190 for weight and 04/03/10 for date. Is there any way to get that corresponding cell? I looked through the function reference for Google docs, but can't get anything going. I tried using some of the functions from the Lookup category, but got nowhere. Most want a cell reference, but the min() function returns a value. I think I need to somehow get min() to give me a cell reference, but I don't know how to do that. HLOOKUP() sort of seemed like it might be appropriate, but the docs were a bit spotty, and it didn't do anything but error out the cell.
Of course, I may be barking up the wrong tree entirely.
Thoughts?
I would use the following two formula's:
MIN(B2:B)
FILTER(A2:A;B2:B=minimal value)
If there are more results, they need to be included as well.
See example file I've created: Getting Corresponding Cell In Google Docs Spreadsheet?
Not barking up the wrong tree, actually very close:
=index(A:A,match(min(B:B),B:B,0))
should meet your requirement.
Working inside out: min(B:B) (as you had) returns the lowest weight (ie 190) in ColumnB.
match then finds the position of that value relative to the start of the range in which the value is searched for. So assuming Date is in A1, that returns 4, being the fourth row in ColumnB, where 190 is. The 0 in the formula is to ensure that only the position of an exact match is returned.
Now we know we need the content of the fourth row we can go looking for the value there in ColumnA with index, returning 04/03/2010.
Not all is ideal however. It is possible that a weight of 190 was achieved on separate days. It is the nature of match that where an exact match is required and found the function stops looking for any further instances. Hence as things stand 04/03/2010 will be returned for 190 however often that is the weight for a day after 04/04/2010 - unless other steps are taken, such as to delete/remove/ignore data from 04/03/2010.
You need to change the order of the column as the search column (the weight should be the first in the search array. Then you can use the VLOOKUP formula:
=VLOOKUP(C7,A:B,2,false)
C7 holds the MIN formula that you used: =(Min(A:A)) - note the column order change
one-cell solution to get minimal value with the latest day:
={MIN(B:B), TO_DATE(VLOOKUP(MIN(B:B), SORT({B:B,A:A}, 2, 0), 2, 0))}
to get all minimal values with dates:
=QUERY(A:B, "select B,A where B matches '"&MIN(B:B)&"' order by A desc", 0)

Resources