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 660

Summary: Line/FastLine doesn't show if Points are too close together
Product: FireMonkey TeeChart Reporter: Daniel Marschall <daniel.marschall>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: IN_PROGRESS ---    
Severity: major CC: daniel.marschall, david
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: Tablet   
OS: Android   
Chart Series: FastLine Delphi / C++ Builder RAD IDE Version: RAD XE6

Description Daniel Marschall 2014-03-24 08:46:20 EDT
We have following chart:

2 axis chart,
FastLine (or Line),
without legend or title,
yMin=300,
yMax=1500,
xMin=0,
xMax=450

We draw points with constant x=315 every 0.01 steps.

The line is NOT visible, regardless of its thickness. You need to zoom in to see the line.

This bug only happens with FastLine/Line, but not with Areachart.

But we want a Line and not an Areachart.

The bug seems to occour, when the points are too close together in horizontal direction.
Comment 1 Daniel Marschall 2014-03-24 08:57:23 EDT
Sorry I meant:

"We draw points with constant f(x)=315 every 0.01 steps."
Comment 2 david berneda 2014-03-24 12:31:11 EDT
Can you upload a test project? Do you mean x or y steps?
Comment 3 Daniel Marschall 2014-03-24 13:38:59 EDT
(Bezüglich comment 2 von david berneda)
> Can you upload a test project? Do you mean x or y steps?

Hello,

I mean x steps.

The code is something like this:

var
  x, y: double;
begin
  x := 0;
  y := 315;
  while x < 450 do
  begin
    Series2.AddXY(x, y);
    x := x + 0.01;
  end;
end;

I can produce a test project tomorrow if you like.
Comment 4 Daniel Marschall 2014-03-25 07:13:50 EDT
Hello. I could sucessfully reproduce this problem with my Asus Transformer Prime TF201 (Android ver 4.1.1) tablet, using the code above.

But I couldn't reproduce it with the Samsung Galaxy Camera EK-GC100 (Android ver 4.1.1).

I think it has something to do with the screen resolution.

For the tablet, I needed to zoom in 2 times to see the line. Screenshots are in the ZIP.

http://download.rinntech.com/marschall/Bug660-Reproduction.zip
Comment 5 Daniel Marschall 2014-03-25 08:28:34 EDT
Note: The bug still exists in the update http://cc.embarcadero.com/item/29708 .
Comment 6 Daniel Marschall 2014-06-16 08:17:49 EDT
Note: This bug still exists in the current XE6 version of Delphi.

I updated my reproduction project at http://download.rinntech.com/marschall/Bug660-Reproduction.zip to make it compatible with XE6 (the FMX stylebook created by XE4 raises a SegFault using XE6)
Comment 7 david berneda 2014-06-16 10:07:59 EDT
We can't reproduce this issue in our devices (Nexus 4,5,7 etc) using XE6, so its hard to determine how to find a workaround, or the cause of the missing line.

There is one method at FMX.Platform.Android.pas that could work different depending on the phone or tablet device, but its not easy to override or apply when drawing line series:

TWindowManager.AlignToPixel

Several things that can be tried, maybe one or some of them fixes the problem:

procedure TMeasurementForm.FormCreate(Sender: TObject);
begin
  // Drawing the line segments all-at-once instead of one-by-one:
  Series1.DrawStyle:=TFastLineDrawStyle.flAll;

  // Increasing the line pen size a little bit:
  Series1.Pen.Width := 1.5; 

  // Changing the Form Quality property:
  Quality:=TCanvasQuality.HighQuality;  // or: "HighPerformance"

  // Skip repeated xy points:
  Series1.DrawAllPoints := False;
end;

At project dpr sources, forcing to use the GlobalGPUCanvas:

uses
  System.StartUpCopy,
  FMX.Forms,
  FMX.Types,
  frmMeasurement in 'frmMeasurement.pas' {MeasurementForm};

{$R *.res}

begin
  GlobalUseGPUCanvas:=True;
  Application.Initialize;
....
Comment 8 Daniel Marschall 2014-06-16 10:31:02 EDT
Hello,

thanks for your reply. Alas, none of these workarounds did help. :-(

This bug does affect the Asus Transformer Prime TF201 (Android ver 4.1.1) tablet.

One thing which might be worth mentioning: When the y-Delta is small enough (the function is "flat" and the y-values do not heavily change), the line will only be visible after 2 zoom-ins. However, if the line jumps up and down with great y-Deltas (like in the generated demo-data), then the line will be visible. So this bug happens when the points are too close together in x-direction.

Using AreaChart does work, but it is too slow and we do not want a filled area under the function graph.
Comment 9 Daniel Marschall 2014-06-16 10:37:53 EDT
Sorry, I was wrong. The data does also not show up if I use y := Random(300) . The reason why the line does not show is because the values are too close together ( x := x + 0.01 ); the y-value of each value does not matter. Any ideas why nothing is shown when the points are too close together in x-direction?