HighCharts: getting access to calculated spline 'points' - highcharts

I'm using the built-in spline curve fit to an x-y plot. Is there a way of getting access to the splined data that HighCharts itself is plotting? I (obviously) have access to my supplied x,y co-ordinates but I'd like access to the HighCharts-calculated spline intermediate values.
Take http://www.highcharts.com/demo/spline-symbols as an example. The raw data is (month,temperature) and the closest point to the mouse get displayed as a tooltip. I'm interested in displaying the intermediate 'points' so that as I move my mouse along a line it displays the calculated spline values.
Is this possible?

This has been dormant for a while but I did manage to figure out a way of doing it. See also a related follow up question.
Say you want to find a 'y' value for a given 'x' on a HighCharts generated spline. If you can get at the SVG path for that spline then you can walk it's length until you hit the required 'x'. Then read off the required 'y'.
This fiddle gives an example: https://jsfiddle.net/r3f2xL6b/1/

Related

How to change PlotLine in highchart from some specific point?

Is it possible to change the plot line from some specific point. One way around is to create two series and plot them on chart them. But we want to change the plot lines from specific point without using two series.

Highcharts :: Need to split y-axis from primary body of chart. Can I display this axis separately from the Highchart?

I have a situation where I need to remove all margins from a highchart and remove the x/y axis so it fills a series of columns in a table completely.
I did that, no problem. Chart goes to the extremes as needed.
What I need now is that pesky yaxis I already removed...but displayed in a table cell outside of the existing highcharts object.
It would seem easy, as though I could just set the overflow property of yaxis to 'visible' and play with the offset...which would work however this would only work if I wanted to re-position the axis within the boundaries of the highchart object. I want him in a different cell entirely.
Is there anyone who has had experience in this situation? Is it going to require me to have a secondary highchart with only a y-axis?
Best answer gets a green check.
EDIT :: I now have dispersed each 'day' into their own column (more bars coming per day [scheduled,actual,etc...]). In order to keep the scales lined up, I manipulate the yAxis:max property and set them all to a derived value.
In the open column (currently w/ text Hourly Trends) is where I would put an additional highchart module with no series data but with the same min/max/tickInterval.
The next big leap will be to see the data is alive and changes w/ schedule. May have to start another thread for that one, no?
Create a new HC object with no data but only the yAxis (making sure it is the right scale, etc). Perhaps add the same series of data to it but hide the series? Add it to the location you want. This seems kludge and not very good practice. Each business use is different but why would you want this?
EDIT based on comment of business rules:
Why not come at this from a different direction and have the individual chart elements (the bars/points/etc) be a single point chart. This way you have one chart per column. You can then set up the yAxis to be text and not worry about the position. If we could see an example of the page layout and the desired result that would help.

Highcharts - multiple plot with the same x scale

I want to make a multiple plots with the x-axis aligned so that we can compare two set of data. I want it to look like this
https://stackoverflow.com/a/11796553/229075
In my case there are some addition requirement that some of the plot are lines and some are bar. So the default scale does not align even if the data range are the same.
I found some good suggestion about "stacking" the charts. It is a little bit complicated but a promising way to try.
https://stackoverflow.com/a/12179023/229075
However I also have other use case that may push the envelop of simple stacking. For example, I'd like to do scatter plot matrix sometime when both x-axis and y-axis have to align like this
http://www.statmethods.net/graphs/images/spmatrix3.png
Rather than putting many chart in one Highchart, this may requires have many separate charts but have better control in how the axis is layout.
If you want to use one one chart, you can use linkedTo option to connect axis.
If you want more simple charts, you can manage to connect axis using event afterSetExtremes, where you can call setExtremes() for another chart.

How do you use CPScatterPlotInterpolationLinear?

I just happened to stumble across "CPScatterPlotInterpolationLinear" via google search for 'interpolation'.
Does this mean that I could plug gaps of scatter/linear data via interpolation?
I had asked a similar question earlier and was told that CP doesn't add points to a graph.
I attempted to create a 6-month fixed-interval scatter plot by creating an array of 180 elements for 180 days/6 months. The missing data/day were filled with [NSNull null] objects... but CP merely plots the non-nulls without the interpolation.
The 'CPScatterPlotInterpolationLinear' enum got me to re-think.
Question: How do I employ 'CPScatterPlotInterpolationLinear' to interpolate missing data on a graph? ... no need to actually add data points, just 'connect the dots'.
When you set the line style on a scatter plot, Core Plot will connect the data points with a line drawn using the given style. The interpolation property controls how the points are connected:
CPTScatterPlotInterpolationLinear: This is the default. Data points are connected with straight lines drawn directly between successive points.
CPTScatterPlotInterpolationStepped: Steps are drawn beginning at each data point.
CPTScatterPlotInterpolationHistogram: Steps are drawn centered at each data point.
CPTScatterPlotInterpolationCurved: Data points are connected with a smooth curved line drawn between successive points.
None of these styles will add data points (i.e., points that can be indicated with plot symbols or data labels). They simply connect the data points provided by the datasource.

How to display live core plot graph in iPad? [duplicate]

I want to use core-plot for drawing line graph dynamically. data won't come at a time, we will be receiving point by point dynamically.
Is it possible to draw the chart dynamically using core-plot i.e drawing point by point as on when we receive the (x,y) point?
Please help me, Thanks.
Yes, you can do this reasonably easily. For each received data point, append it to an array of values to display. As these data points come in, call -reloadData on the Core Plot graph (or just the particular plot) to redraw the graph, passing in the array you just added a value to in response to the -numbersForPlot:field:recordIndexRange: delegate method.
If you need to adjust the plot range to track your data points (for a moving ticker), recalculate the new CPPlotRange for the X axis and set the plot space's xRange property to that.
Use the CPTestApp-iPhone, AAPLot, or StockPlot examples as templates for how to set up the line chart overall, and modify from that starting point.
I do something similar to this on the Mac in a scientific application:
(source: sunsetlakesoftware.com)
Sounds like you could make use of a demo project I put together and wrote about here (not core plot related though).
It draws a EKG graph but should easily be modified to use another input than the repeated "heart beat"...See line 320 in EAGLView.m where the indata is entered into the array.

Resources