HighStock not Overlapping data - highcharts

Currently i´m registering every 10 seconds if my services are accessable via netcast command.
nc -zvvw 10 ip port
A success is registered as a 1, otherwise a 0. The format is something like this:
date;server1;server2;serverN+1
But, it seems like Highcharts put some decimal data that i dont know where are from. And the data is not overlapping at all. (The 1 or the 0) Or at least two series than i'm aware of.
Here is an example about i'm trying to explain if my spanish level is not good enough
http://jsbin.com/overlaping/3/
can anybody help me please.
Edit 1:
The data is from a json source, it's looks like this:
var data = {"titulos":["fecha","server1","server2","server3","server4","server5"],"detalles":[[1389495600000,1,1,1,1,1],[1389495600000,1,1,1,1,1]]}
But for an entire day, every ten seconds.
Edit 2:
Wergeld noticed that i having the same timestamp (on ms) for more than a row of data. That was 'cause i was parsing the date without seconds.
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
But i added the seconds and it is given me different dates for every row (as i should expect), but the problems persist.
The data now looks like this:
{"titulos":["fecha","yelcho","villarica","coya","cunco","culenar"],"detalles":[[1389495606000,1,1,1,1,1],[1389495616000,1,1,1,1,1],[1389495627000,1,1,1,1,1],[1389495637000,1,1,1,1,1],[1389495647000,1,1,1,1,1],[1389495657000,1,1,1,1,1]]}
Edit 3:
it seems to be some kind of behaviour at a large amount of data and trying to display all. If i zoom it enough, it display correctly. There is a way to display it properly even at full zoom out?
Edit 4:
I ended using this code to solve my problem. Thanks to Pawel Fus for his help.
plotOptions: {
series: {
dataGrouping: {
enabled: true,
approximation: 'open'
}
}
},

This is caused by dataGrouping, you can disable it.
However, it may be very slow to display 10 000points (with markers) on a chart width width 1 000px (10 points on a 1 pixel).
Reference.

Related

Grafana: Panel with time of last result

I have an elasticsearch instance that receives logs from multiple backup routines. I'd like to query ES for these logs from Grafana and set up a panel that shows the last time for the different backups. Ideally I would also like to be able to show this in color if the time is longer than a certain threshold.
Basically the idea is to have a display that shows, for instance, green if a certain backup has been completed in the last 24 hours, and red if it hasn't.
How would I do this in Grafana with ES as the datasource?
Exact implementation depends on the used panel.
Example for singlestat: write ES query and then select Stat: Time of last point, you may need to select suitable unit/format:
Unfortunately, Grafana doesn't understand thresholds in your requested time format (older than 24 hours). You will need to return it as metric (for example as age of last backup in seconds) = you will need to write query for that. That means, that you will have 2 stats to show (last time + age), so you won't be able to use singlestat. Probably table panel will be better - you can use thresholding based on the age metric there.
In addition to the great answer by Jan Garaj, it looks like there is work being done to make this type of thing much easier in the future.
Check out this issue to check progress.

Timeseries Mathematica Max and Min Values

I've been using Mathemathica in order to collect wind speed data in a certain location. Mathematica gives me a TimeSeries from which I would like to know what is the maximum value and the minimum one. I've used "FindPeaks" function, but as it is not a regularly sampled time series the function does not work. Is there a way to get the maximum value?
The following is the data:
data = WindSpeedData[{19.416258, -99.719266}, {DateObject[{2016, 1,
1}], DateObject[{2017, 1, 2}]}]
This
Normal[data]
will undo part of the layer of Timeseries that your actual wind speeds are wrapped up inside of.
In that you can see that what you probably want is part of the second item in each list, that appears to be the actual speed. So
Max[Map[#[[2, 1]] &, Normal[data]]]
will look at the beginning of the second part, which is your speed, and then try to find the maximum value.
For your example data that shows Max[29.0802, "NotAvailable"] and that 29.0802 is the maximum wind speed.
That trailing "NotAvailable" is still some part of their wrapping the actual data up inside layers. It is possible that there is one missing wind speed in there and Max doesn't know what to make of that.
Thanks #Bill,I used
Max[data]
It threw me ["Not available", 46.8 km/h]
I just used your code and gave me the same result but in different order [46.8 km/h, "Not available"]. I double checked the datum (46.8) by displaying the data in a grid. Thank you very much, I will use the normal function further on.

Plot raw time series with Kibanan Timelion

I might not get something. How can I plot a raw time series with Timelion without applying any further aggregation? Just the raw data of a field over time that I have in an index. Of course I select the proper time window for the data.
I was trying to achieve the same thing, but didn't fully get what I wanted, but maybe these steps will help you.
My data was on by minute basis, so I don't want any more frequent fragmentation. Selecting interval = 1m helps only for short periods of time, but adding "interval=1m" into .es() block works on long periods, too.
To have lines not to return to 0 in between points, use .es().fit(carry)
.es().scale_interval(1m).fit(scale) - this is my chart to return to 0 if there were no data for certain period rather than carrying the line on the same level.
.es(metric=max:value_field) helps not to sum up the values, but show the max of the aggregated set.
My charts are still weirdly aggregated, but maybe it'll help someone.
Useful links:
Sparse time series in timelion
https://www.elastic.co/blog/sparse-timeseries-and-timelion
Scaling issue 1
https://discuss.elastic.co/t/diferent-value-on-y-axis-depending-on-time-interval/67785
Scaling issue 2
https://discuss.elastic.co/t/timelion-giving-wrong-metric-aggregate-value-on-enlarging/132789
Scaling issue 3
https://discuss.elastic.co/t/re-timelion-giving-wrong-metric-aggregate-value-on-enlarging/132925

highcharts/highstock tooltips issue : point.config[2] missing, fine on subset of same data

I'm evaluating Highcharts. It is a brilliant charting solution but I've hit a problem I just cannot work out.
I have a dataset where each point has x, y, and additional data in an array for example:
[[1432022880000,6,['192.168.100.144','36215','192.168.100.191','5432','tcp']],
[[1432022880002,4,['192.168.100.144','36216','192.168.100.191','5432','tcp']],
...
I use a custom tooltip formatter to show the conversation details, which relies the metadata in the array at point.config[2]
With a fairly modest dataset size of about 300 points the tooltips won't function and I get the following in the console:
TypeError: 'undefined' is not an object (evaluating 'this.point.config[2][0]')
However, it works fine with a subset of the exact same data. Unless I've missed something there's nothing wrong the larger dataset but I'm completely stuck for what is happening. In the code of the app I use setData to update the larger series and although there are no errors thrown onto the console the point config objects lack the array at [2], and it works fine for the smaller dataset.
Here's a fiddle for the smaller(subset) of data, where the tooltip works:
http://jsfiddle.net/stevehicks/m37sdef5/14/
...and here's one for the "full" dataset where the problem exists:
http://jsfiddle.net/stevehicks/vhx66vgb/11/
Any help would be greatly appreciated as I've burnt over a day on this :(
Similar kind of issue has been reported in the High Charts Repos page
Bad Performance with large Series (tooltip specifically)
Follow up the issue and track the workaround provided on the page.
Kacper from the Highcharts support team has pointed out that it's the effect of datagrouping :
The problem is that large data set is grouped to fit in window and that grouped points do not have custom properties.
Grouping can be disabled.
plotOptions: {
series: {
turboThreshold: 0,
dataGrouping: {
enabled: false
}
}
},
Example with current version of Highstock : http://jsfiddle.net/vhx66vgb/12/
For older version this fix doesn't apply - no plot is being rendered: http://jsfiddle.net/vhx66vgb/13/
Many thanks to Kacper !!

Highcharts scatter plot with lots of data points running really slow

I've seen a few suggestions here, but nothing seems to apply to my situation. I've also seen some unresolved similar issues. I have scatter plot with a lot of data (about 40k) points. It's really slow. The link below (genetic data - called a Manhattan plot) will eventually load, but it's just slow. I need to find a way to optimize performance.
http://ricediversity.org/test/highcharts/examples/line-ajax/index-b.htm
Also, I'm trying to add additional info (data fields) to my tooltip from my data file, but I can't get that working either. Any suggestions?
You can try to disable animations / shadows.
http://api.highcharts.com/highcharts#chart.animation
http://api.highcharts.com/highcharts#plotOptions.series.animation
http://api.highcharts.com/highcharts#tooltip.animation
http://api.highcharts.com/highcharts#plotOptions.series.shadow
As far as tooltips, check out the highcharts data api, specifically number 2 in the list. If that doesn't cut it for you, you can pass in an array of objects where you specify the data you want to get. Then, in the formatter, it is easy to reference. Here's a JSfiddle showing how to reference the names once they're in your data array.
The formatter is
formatter: function () {
var s = "";
$.each(this.points, function (i, point) {
s += point.point.nameList[0];
});
return s;
}
and the data sets look like:
data = [ ...,
{x: xval, y: yval, nameList: myListOfNames},
...]
where xval and yval are the x and y values of the data points and myListOfNames is an array of strings.
There are some hints on optimising performance on the highcharts website here: http://docs.highcharts.com/#faq$optimize-performance
However, with that many points, I would consider using highstock. There is no way to make out the detail of that many points, so aggregating them in some way would make a better chart (http://docs.highcharts.com/#data-grouping).
Perhaps too late to be useful (and the example link no longer works, so I'm not sure if this applies), but there's a newish Highcharts plugin to downsample time series data with the intent to retain the shape of the original data.
http://www.highcharts.com/plugin-registry/single/13/Highcharts-Downsample

Resources