NearestPoint does not work with points very close to axis - teechart

I am using NearestPoint which reports the x/y values in a jlabel, but I have noticed that if I hover over a point that is on the edge of the chart [extremely close to any axis] that it is not detected by NearestPoint. Is there a way round this problem or how can I create space between the edge of the chart and the points?

Is there a way round this problem
This works fine for me here. Can you please send us a simple example project we can run "as-is" to reproduce the problem here? You can send it at http://www.steema.net/upload/
or how can I create space between the edge of the chart and the
points?
You can use axis minimum and maximum offset, for example:
tChart1.getAxes().getBottom().setMinimumOffset(10);
tChart1.getAxes().getBottom().setMaximumOffset(10);

Related

Arcgis create random points using minumum allowed distance

I am working in Arcgis 10.3.1 and I am trying to add some random points into a polygon shapefile as the center for circular sampling plots, however, every time I use the minimum allowed distance (I use 15 m because the plot radius will be 10 m) I get an error.
Without using the minimum allowed distance it works fine but usually the samples spacing is not right.
I was thinking maybe there was not space in the area to have such spacing but the area i 4000 m2 and a 10m radius circular plot is only around 300m2 (I need only 4). Even if I use 2m distance I get the error.
I am not sure if I am using it right. Is there any other way to add random points?
Any imput is welcome
Sorry I just figure out what was happening.
Apparently there was a file with the same name as my output and that is why I got the error codes.

How to increase the coordinate resolution of a d3-geo chart

I have a GeoJSON file with small details and features that I want to render using D3. Unfortunately, important details are lost because D3
removes polygon coordinate pairs that are closely spaced.
I've set up a small example to show this. Both links use the exact same GeoJSON data, rendered with both D3-geo and mapbox through github.
Specifically, notice the two areas marked by the red circles.
https://bl.ocks.org/alvra/eebb06be793bc06ff3ae01e6945298b6
https://gist.github.com/alvra/eebb06be793bc06ff3ae01e6945298b6
The top one one marks a part of polygon that is rounded using many closely spaced coordinate pairs, but D3 removes most points and just draws a rough square end.
The lower red circle marks a tiny triangle that is removed altogether. The adjacent polygons should touch exactly, but are also affected by D3's loss of precision.
I haven't found any documentation about D3's coordinate precision or a (configurable) feature size limit.
I've tried decreasing D3-geo's EPSILON and related EPSILON2 values and that removes this problem (for me), although I'm sure even smaller features will still be affected.
Assuming this is related to the fact that D3 uses proper geodesics for polygon segments, while the other mapping libraries just draw straight lines (in the output coordinate space),
I was hoping that this process can only introduce new points.
I haven't been able to find other users experiencing similar problems with small features, although I'm surprised this has never come up before.
Does anyone have an idea about the proper way to deal with this?
Through epsilon, I've narrowed the problem down to this use of pointEqual(). This indicates the problem is with clipCircle considering closely spaced coordinates equal and removes them.
Indeed, if I disable circular clipping projection.clipAngle(null), the problem disappears.

Y axis level need to be moved little left in dc.js chart

I am drawing charts using dc.js.The following is a frequency VS Day Chart
I am using the following line to generate the titles:
..something.yAxisLabel("Frequency").xAxisLabel('Day');
But the problem is as you see when the frequency is so large the Y axis title is colliding with the frequency numbers. So is there any simple way to move the Y axis title left?
The layout of auxiliary elements such as axes and legends is not completely automatic in dc.js; use .margins() to adjust where necessary.
https://github.com/dc-js/dc.js/blob/master/web/docs/api-latest.md#marginsmargins
It would be great to figure this out automatically but it is difficult to calculate, and easy to work around, so I guess no one has gotten annoyed enough to submit a fix. :)

Match indexOfVisiblePointClosestToPlotAreaPoint to one axis?

I am trying to achive a mouse over high light with is common in stock charts.
Is it possible to match indexOfVisiblePointClosestToPlotAreaPoint to the closest point in only one axis (and not care of the other axis at all), as green line in the screendump. The point may not be the closest point if you consider both X and Y-axis (= red line), which Core Plot correctly calculates now.
Am I too tired or is there a way to only match "vertically" which point is the closest or I am going down the wrong path using indexOfVisiblePointClosestToPlotAreaPoint for this? ;-)
Thanks in advance!
The plot data is sorted from left to right. Find the data points on either side of the green line. It's trivial to determine which one is closer to the line. A simple linear search is fine if you don't have a lot of data. Use something more efficient like a binary search if you have many data points.

Drawing custom paths in D3.js without using fake data points

Trying to implement EKG style "heartbeat" chart from a design and I'm having a hard time getting D3 to draw a path like I need.
The design spec states that the graph needs to return to nuetral/zero point between each and every data point, and that the curved path from the zero point should be close to the data point itself and rise sharply. See the attached images below
Here is the design....
And here is my attempt to match the curve with dummy data (black circle data points)...
The graph has a time scale X axis and a linear Y axis that ranges from 0 to 2 (my data points are 0,1, or 2 respectively). The line is using 'monotone' interpolation which is the least terrible looking.
Question:
Is there a better way to get this appearance without dummy data points?
Question-behind-the-question:
What is the best way to get D3 draw a custom paths (e.g. from a function)?
Sub-question:
Why does the monotone interpolation curve the path inward so sharply between the last 2 data points?
Any help is appreciated! The designers and client won't budge on this one, so I have to get it as close possible :(

Resources