I want to get all series data in highstock callback function. Please see this fiddle, serie.data are all empty array.
The very strange thing is it related to rangeSelector. If I set to this way
rangeSelector: {
selected: 4
},
It will return data.
Following is what the series.data documentation says
data
Read only. An array with the series' data point objects. In case the
series data length exceeds the cropThreshold, or if the data is
grouped, series.data doesn't contain all the points. It only contains
the points that have been created on demand. In these cases, all
original X and Y values can be read from series.xData and
series.yData. Additionally, series.options.data contains all
configuration objects for the points, whether they be numbers, arrays
or objects. Returns
Array
series.data only contains certain data and not all the points and looking at the source code it seems series.data is populated when the series is cropped or translated, hence setting rangeSelector.selected=4 results in cropping and hence data array is populated. For some reason it appears series.data is left empty if all the data is shown, this happens when rangeSelector.select=5. I would advice against using series.data for this unpredictable behavior
Use series.points if you want the points that are currently visible, or use series.options.data (or series.options.xData or
series.options.yData) to get all data (or xData array or yData array)
Related
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.
I am looking for a setting in Highcharts/stock that would allow me to apply a different format to displayed values of data, but not to the actual data as it is loaded into the series data. For example, we would like to plot y-axis data with precision up to 16 significant digits, and likewise, time values that use 6-8 sig figs. But that's not the precision we would like displayed in the tooltips, or other labels. However I am unable to find a way to format it without affecting both what is plotted and what is displayed. Here is an example of why this is a problem: let's say we have data points taken at .0001234s, .0001244s, .0001254s, and .0001264s, but we want to format the display of the time to ".0001" for all 4 data points. If we format it, then the "plotted" data ends up looking like it occurred at the same time-stamp, thus producing a stair-step look to our waveform.
I have looked at the custom functions that I can create to override tooltip display, but it doesn't appear that there is an easy way to make that very generic so that I can apply to all of the various chart instantiations (we use lots of different chart types), and that only covers tooltips; X-axis labels and Y-axis labels would also need separate functions for overriding those display values; there's possibly other places I haven't thought where the display might be affected as well. Is there any single, centralized place where the data points display value or format can be changed?
Example of stair-step appearance:
TIA
If you want to display various numbers (axis labels, tooltip, etc.) with various number of decimal places, you can use Highcharts.numberFormat function.
API Reference:
https://api.highcharts.com/class-reference/Highcharts#numberFormat
Example:
http://jsfiddle.net/eg0vepgq/
Actually I am new to highcharts. I am having a problem while plotting multiple bar series in using highcharts. From controller, I get the arrays of objects. How i will be able to pass it to data to plot it in multiple series. For example, I have 3 arrays of objects. I want to plot these arrays in 3 different series. How I can be able to accomplish it?
I have one scenario. The X-axis in graph contains values 0,300,600,900,1200,1500,1800 from right to left(opposite to actual graphs).
I have an array like 0,1,2,3,4,5,6,7,8,9,etc.
now, i want to plot the data on the graph. For that I am using like this.
[thePlot insertDataAtIndex:0 numberOfRecords:1];
Because I want to insert the data at index '0' always and previous values move from right to left. But it is not moving because the data is always inserting '0' index.
But, When I use following code it is moving but data is inserting at last index.
[thePlot insertDataAtIndex:[array count]-1 numberOfRecords:1];
Could you please help me...
Thanks
Neither of those methods change the data that the plot already has. To make things move, adjust the xRange of the plot space. This is how the "Real Time Plot" demo in the Plot Gallery example app works.
I have to create controls based on an object that I'm getting from a db call. The object can be anything, so the chart has to be created dynamically. To illustrate my issue lets say that the object looks like
var obj = [{name:"int",data:[2,5,8,11,12]},
{name:"double",data:[1.1,4.1,7.1,10.1,11]}]
After parsing the obj the user can select what they want to plot. Whether they want to see int or double on the x/y Axis. Then plot the series they want to see. My issue is that every time I plot the series no matter how I format it plots the series with the yAxis and the value's array index on the xAxis. How could I make it so the user can plot the int/double relation using either series? Thanks.
So you can use select html obejct, then catch select event and i.e addSeries() function to chart.
http://api.highcharts.com/highcharts#Chart.addSeries()