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 2073

Summary: line series tool NearestPoint never fired on a YValue = 0 point
Product: .NET TeeChart Reporter: truthtracer
Component: ToolsAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED NOTABUG    
Severity: critical CC: chris
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: sample project

Description truthtracer 2018-08-15 04:17:11 EDT
Created attachment 843 [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-16 10:50:18 EDT
This is because the .NET Framework's Rectangle.Contained method ( https://docs.microsoft.com/en-us/dotnet/api/system.drawing.rectangle.contain ) returns false if the point is touching the boundary of the rectangle.

To remedy this you can add in an extra pixel, e.g.

annotate.TextAlign = StringAlignment.Center;

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

tChart1.Axes.Left.MinimumOffset = 1; //<- workaround here