Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2074 - line series tool NearestPoint never fired on a zero YValue point
Summary: line series tool NearestPoint never fired on a zero YValue point
Status: RESOLVED NOTABUG
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- major
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-15 04:25 EDT by truthtracer
Modified: 2018-08-19 23:08 EDT (History)
1 user (show)

See Also:
Chart Series: FastLine
Delphi / C++ Builder RAD IDE Version:


Attachments
sample project (13.63 KB, application/x-zip-compressed)
2018-08-15 04:25 EDT, truthtracer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description truthtracer 2018-08-15 04:25:28 EDT
Created attachment 844 [details]
sample project

tchart version 2018.05.04

1. create a tchart control, add tool NearestPoint and a fast line series
2. series.FillSampleValues(10), then set some points YValue to 0

set marks visible to see clearly, the NearestPoint tool never fired on these YValue = 0 points

plz see the attachment project
Comment 1 christopher ireland 2018-08-17 04:40:06 EDT
Internally TeeChart uses the Rectangle.Contains method ( https://docs.microsoft.com/en-us/dotnet/api/system.drawing.rectangle.contains?view=netframework-4.7.2 ) to determine whether to include a series point into the nearestpoint calculation or not. However, this method returns false when the point is touching the rectangle boundary. To counteract this we can increase the size of the rectangle, e.g. 

series.FillSampleValues(10);
series.YValues[2] = 0;
series.YValues[4] = 1;

tChart1.Axes.Left.MinimumOffset = 1; //<- offset one pixel

The nearesttool now detects the point at 0 (zero).
Comment 2 truthtracer 2018-08-19 23:08:38 EDT
tChart1.Axes.Left.MinimumOffset = 1

Works.

Thanks very much !