CustomLinePointColoringAndShaping not working in small chart

Found a possible bug in LightningChart? Report it here.

Moderator: Queue Moderators

Post Reply
frank
Posts: 51
Joined: Tue Mar 25, 2014 9:04 am

CustomLinePointColoringAndShaping not working in small chart

Post by frank » Thu Aug 28, 2014 3:57 pm

Hi,

as discussed once via email, I'm using CustomLinePointColoringAndShaping to "hide" invalid values by setting them to a large negativ y-Value and drawing the points in between transparent. This works very well. As I have multiple charts in one window, and they can be resized freely, I now noticed that CustomLinePointColoringAndShaping doesn't work for small heights.

Please see attached screenshots

Do you have any ideas? Could it be the "invalid" negative value is calculated so imprecise for small heights, that it no longer exceeds the threshold? I was told not to use negative NaN, so now I use -10^6.

Best regards,
Frank
Attachments
CustomLinePointColoringAndShaping_FAULTY.png
CustomLinePointColoringAndShaping_FAULTY.png (2.68 KiB) Viewed 10603 times
CustomLinePointColoringAndShaping_OK.png
CustomLinePointColoringAndShaping_OK.png (2.92 KiB) Viewed 10603 times

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: CustomLinePointColoringAndShaping not working in small c

Post by ArctionPasi » Thu Aug 28, 2014 4:03 pm

Hi Frank,

CustomLinePointColoringAndShaping event is based on screen coordinates info. Probably the invalid "values" are getting same X or Y screen coordinate than the actual data points?

Does changing the "invalid" value for example to 0 help?

I'd appreaciate if you could post a project or code snippet ready for reproducing the issue.
LightningChart Support Team, PT

frank
Posts: 51
Joined: Tue Mar 25, 2014 9:04 am

Re: CustomLinePointColoringAndShaping not working in small c

Post by frank » Fri Aug 29, 2014 7:36 am

Hi Pasi,

please see attached example. Just resize the window to see the described behaviour.

Best regards,
Frank
Attachments
WpfApplication2.zip
(38.85 KiB) Downloaded 742 times

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: CustomLinePointColoringAndShaping not working in small c

Post by ArctionPasi » Sat Aug 30, 2014 2:14 pm

Hi Frank,

CoordToValue converts screen coordinates to axis values. Because the Y range in pixels is low, it can't output values where -1000000 and -999999 could be isolated. They become same, so to say.

Use -999000 or equivalent, even larger number as overshoot threshold.
private readonly double InvalidValueOvershoot = -Math.Pow(10, 6) + 1000;

;)
LightningChart Support Team, PT

Post Reply