http://api.highcharts.com/highstock#plotOptions.series.dataGrouping.approximation
I don't mind that highcharts is data grouping my data. What i do mind is that i can not seem to bring back a flag saying if it is currently active on the zoom level or not.
If there is data grouping, i want to bring back that information for the user to tell them this is not the exact data, and that there is some approximation that is occurring.
When i zoom in, the data grouping stops and approximation does not exist any more and i see the accurate data, and i want to tell users that no approximation is being doing right now.
I haven't been able to find a way of bringing this infomration forward to the user, is it possible?
I seems that the object you are looking for is currentDataGrouping.
You can access it using i.e. chart.series[0].currentDataGrouping.
If data grouping is not active then currentDataGrouping will be null.
Example: http://jsfiddle.net/c3wr3gss/
Related
My goal is to render time-series data from set locations on a map. Essentially, I have about 30 predefined (static) locations in Switzerland from which I will be receiving real-time data. The data itself is relatively simple, just the signal/noise ratio of the signal we're receiving, which should be updated every few seconds or every minute. I am using InfluxDB as my database. Are there any specific setups I should be using for this kind of visualization?
My first question is: is it best to use the worldmap panel or the geomap panel at this time? I seem to be finding more information/documentation on the worldmap panel even though i have also read that geomap is (or at least will be) its replacement.
Second, I assume that since I'm using time-series data, that I should be using the Time-Series format, and not the Table format. However, I have not been able to render any data points using the time-series feature, even by following the simplest of examples in your documentation. The best I can do is use the Table feature, and internally remove previous points from my database at every iteration (so that multiple points aren't rendered at the same time for each location). Here are two screenshots of when I'm able to render data on the geomap using the Table format, and then after switching to Time-Series format that the points are no longer there (note that I have the same problem with the Worldmap application as well).
I'm able to render data using the Table method:
...but not using time series:
Thanks for any help!
For rendering timeseries data on the geomap, you must convert your lat/long fields to a single geohash field. You'll have to do that prior to inserting the lat/longs into influxDB
See this answer
I am currently using Firestore for my iOS app and I need to implement a scalable solution for my posts feed. I need to get posts within say 20 miles, order them by date, and limit the amount of posts fetched for pagination. Any and all database solutions would very much appreciated! Thank you!
As a low budget/time alternative to libraries, we have implemented storing the first few digits of lat/long coordinates as a document or collection name and then accessed data that way. The first decimal place gives resolution to around 10 miles or so (exact values for longitude change depending on what latitude you are at). So in your database you could have a collection or document named something like +33.6-112.0. This would mark a reference in Firestore to put all data within (33.8 N, 112.0 W). Be careful with how you round the exact location data before placing it in the respective document or collection.
Then you can retrieve all data at any location you want. This may not give you exactly 20 miles, but some client side sorting can handle that. Note you could make the reference go to any decimal place necessary to achieve the level of precision you are looking for to minimize data base calls (to save you money) and minimize impact on the user's cell data plan.
This is a rather simple solution with limitations, maybe for an MVP, and if not careful could pull way more data than anticipated.
Below is a chart showing the approximate physical distance between each decimal place at the equator. So for example, the distance between (33.3 N, 0 W) and (33.5 N, 0 W) would be about 14 miles.
Neither of those databases have native geospatial querying capabilities. You would have to use some sort of add-on library to help with that. Geofire and Geofirestore are popular for this.
I am predicting stock price of a company , I have used everyday changes in time series, but the negative changes are needed and I cant use log transformation on it. So is it ok if I model the sign as one more variable.
If you normalize and have a single variable, time-series has the property to take care of crests and troughs . There wont be any need of having the signs.
I faced this same dilema sometime back. I figured its not that needed unless you want to give pointer on weather the prices will go up or down also in future.Otherwise no.
Can you give a more clear picture on whats the objective and what data are you considering !
I am thinking about how to structure the data within my app and one of the most important lookups will be closest location from a collection of location (10,000+ locations) and I'm looking for the fastest and most efficient way to do this.
Ideas I have:
Use Core Data and store cllocations or doubles, query with a predicate to order by closest to reference location
Store them in an sqlite database and use the distance formula in sql query
Load all locations into memory into some sort of a data structure (array, linked list, hashmap, etc.) and compute the distance a different way
Of these solustions, which would be the fastest/most efficient? Or is there another solution you would recommend?
As others have mentioned, you can't sort by a calculated value with Core Data, so a query for the closest location is unfortunately out. I've used the following "boxing" approach to approximate that, which might or might not meet your needs:
Calculate a box around the target location. The offset in degrees is something you'll need to work out, but the Wikipedia article on decimal degrees can be a good starting point. Offset your target by +/- some number of degrees to get a rough rectangle.
Fetch every location within that rectangle.
Sort the results in memory to find the closest result.
If you want to make one request for the closest location, you'll probably have to work with SQLite directly. I wouldn't load all of the points into memory without a careful examination of the total memory impact of doing so, and an understanding of how much memory your app is using for other reasons at the same time.
I wish to store time series data with versioning. By versioning, I mean that I might have a metric energy_mwh with tag meter_id=123 and a fieldset something like this time=2016-01-01 10:00, mwh=20.50, read-time=2016-01-01 20:15 and if I re-read the meter at a later time I want to keep both the new and old version of the meter reading. Later when I query the data I will be mostly just interested in the mwh value with the highest read-time for any given time. If I query over a range of times the read-time is going to vary.
I am thinking of using InfluxDB or some other time series database with a similar data model.
Is there a right way of doing this? I believe that I must keep read-time as a tag - not a field or I will lose the older version of the data. I guess that is answer - but it doesn't feel right to me to have what I see as a piece of data: read-time sitting in an identifier - specifically a tag. Am I on the right track?