|
Spline Layer: Retrieving values from chart |
Posted by Roopesh on Jul-03-2014 21:05 |
|
Hi Peter,
I am using Spline Layer for plotting as shown in the attached sample screen.
double data0[] = {32, 39, 23, 28, 41, 38, 26, 35, 29};
double data1[] = {50, 55, 47, 34, 47, 53, 38, 40, 51};
against the x axis points {0, 10, 20, 30, 40, 50, 60, 70, 80}
Right now I am able to see the tooltip for the plotted Y points.
In this example, I wanted to retrieve the y axis value for the following x points
0,1,2,3,4,5,6,7,8,9,10. But now I have data only for 0 and 10. How can I retrieve the
values for which I have not supplied any data to chart director ?
Thanks in advance,
Roopesh
|
Re: Spline Layer: Retrieving values from chart |
Posted by Peter Kwan on Jul-04-2014 00:21 |
|
Hi Roopesh,
The spline is a graphical effect. ChartDirector internally does not actually compute the y
data value at any particular x data value (eg. 1, 2, 2.5, 4.975, ....). As a result,
ChartDirector does not know the y data value at any particular x data value other than
those provided by your code.
In some systems, ChartDirector may not even to compute the spline at all. For example, if
SVG is used as the output, ChartDirector just tells the viewing device (typically the
browser) to join the points with a spline, and ChartDirector never computes the spline itself.
Regards
Peter Kwan |
Re: Spline Layer: Retrieving values from chart |
Posted by Roopesh on Jul-04-2014 13:17 |
|
Thank you. |
Re: Spline Layer: Retrieving values from chart |
Posted by KarenA on May-30-2016 03:51 |
|
Hi
I basically asked for this in another thread earlier today
If CD can Draw the line it has to be able to calculate the position of every point on on the line...
So it should be able to give us that position and from that we should be able to get the Y Value, at least to the resolution of the chart...
It would be really helpful to be able to do that for certain applications
Please consider adding that capability
- Karen |
Re: Spline Layer: Retrieving values from chart |
Posted by Peter Kwan on May-31-2016 01:09 |
|
Hi KarenA,
If the curve is rendered by ChartDirector (instead of by the SVG viewer or PDF viewer), ChartDirector needs to plot the pixels. However, ChartDirector cannot keep track of each pixel it has ever drawn, so those information are not retrievable.
Also, as mentioned in my reply to your other thread, ChartDirector does not really have an algorithm to compute x from y or y from x for a spline. There is also no standard on how to draw a spline, which means a spline is just an arbitrary curve that passes through the data points and looks nice. Everyone can draw a spline differently, and different versions of ChartDirector can potentially draw the spline differently. The values along the spline should not be assumed to have any meaning or significance, other than looking nice.
If you need the values between your data points, we suggest you to compute the intermediate values using the algorithm that suits the nature of your data. The computed points can be included in your original data point and than be passed to ChartDirector for plotting.
(In contrast to spline curves, linear regression and polynomial/exponential/logarithmic regressions are standard statistics techniques. The resulting lines/curves have statistical significance and ChartDirector does provide the parameters for those lines/curves.)
Regards
Peter Kwan |
|