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 672

Summary: Null values within the values should be ignored when calculating the ranges
Product: HTML5 JavaScript TeeChart Reporter: Alexander Cosman <alexander.cosman>
Component: AxesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: major CC: marc
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: The bad chart with wrong minimum and maximum
The good chart with correct minimum and maximum

Description Alexander Cosman 2014-03-27 12:19:40 EDT
When we add null values in the values array of a serie. The minimum and maximum of the axes are calculated wrong. The inserted null value should be ignored, instead of assuming it was 0. 

e.g we create a chart that shows a frequency +-50hz. The minimum and maximum are around 49 and 51, when there is no null value within the values. When the null value is added, the minimum is changed to 0.
Comment 1 Alexander Cosman 2014-03-27 12:20:30 EDT
Created attachment 135 [details]
The bad chart with wrong minimum and maximum
Comment 2 Alexander Cosman 2014-03-27 12:22:06 EDT
Created attachment 136 [details]
The good chart with correct minimum and maximum

For this chart we don't have any null values within the values
Comment 3 marc meumann 2014-03-28 07:27:47 EDT
reproducible.

These codelines may be used for tests:

function draw() {
  Chart1=new Tee.Chart("canvas");
  Chart1.addSeries(new Tee.Line([20,19,18,17,16,15,14,13,12,11,10,11,12,13,14,null,16,17,18,19,20,21,22,23,24,25,26,27,28,29]) );
  Chart1.draw();
}
Comment 4 marc meumann 2014-03-28 11:25:50 EDT
"The Math.min function performs (the internal function) ToNumber() on each array element, which in turn coerces the values to Number."

ref.
http://stackoverflow.com/questions/11817861/math-min-apply-returns-0-for-null

Fix applied to ArrayMin/ArrayMax, teechart.js
Comment 5 Alexander Cosman 2014-03-28 11:43:05 EDT
Where can I download the new version?