ViewXY,IntensityGrid - Ranges

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
ahe
Posts: 51
Joined: Tue Aug 11, 2015 4:33 pm
Location: Düsseldorf, DE

ViewXY,IntensityGrid - Ranges

Post by ahe » Tue Feb 23, 2016 3:46 pm

I have a problem with an IntensityGrid. Some of the data provided to me was recorded "backwards" (decreasing x-axis), but it is shown mirrored.

After a bit of debugging I found out that when setting up the IntensityGridSeries and during rendering, it seems that there are multiple places where the RangeMin and RangeMax are ordered again, thus resulting in a mirrored data set.

Code: Select all

	double minX = 2.0;		// minX > maxX !
	double maxX = 0.0;	
	double minY = 0.0;
	double maxY = 2.0;
	
	IntensityGridSeries _grid;
	
	// Will set the properties as RangeMinX > RangeMaxX, but still output as if RangeMinX < RangeMaxX
	_grid.RangeMinX = minX;
	_grid.RangeMaxX = maxX;
	_grid.RangeMinY = minY;
	_grid.RangeMaxY = maxY;

	// Will sort and set the properties so that RangeMinX < RangeMaxX
	_grid.SetRangesXY(minX, maxX, minY, maxY);


Since it is not documented, does the series expect "min < max" ? Can you confirm this as undefined behaviour?
Why does SetRangesXY() change min and max instead of throwing an exception? The then provided data will not match the range.


As a workaround, I think I will need to reorder the data on my own depending on min>max.


As usual, I added sample code for reproduction, screenshot:
IntensityGrid_inverted_data_range.png
IntensityGrid_inverted_data_range.png (43.98 KiB) Viewed 7536 times

Thanks, Andreas
Attachments
AL_IntensityGrid_Ranges.zip
(11.52 KiB) Downloaded 541 times

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

Re: ViewXY,IntensityGrid - Ranges

Post by ArctionPasi » Wed Feb 24, 2016 5:03 pm

Hi Andreas,

The min and max properties can't cross. There's built-in delimiters in the properties. SetRangesXY method flip the values if they cross. It's the same logic than axes' Minimum and Maximum property and SetRange method has.

The data array low address are bound to the RangeXMin and RangeYMin. So in this case you should reverse your data column order:


double[][] _data =
{
new double[] { 1.5, 2, 3 },
new double[] { 1, 1.5, 2 },
new double[] { 0, 1, 1.5 },
};
LightningChart Support Team, PT

ahe
Posts: 51
Joined: Tue Aug 11, 2015 4:33 pm
Location: Düsseldorf, DE

Re: ViewXY,IntensityGrid - Ranges

Post by ahe » Thu Feb 25, 2016 8:11 am

Thanks, that's what I was suspecting. I will mirror the data accordingly.

Could you please also add the information about this constraint to the Intelisense help (Arction.LightningChartUltimate.xml) and the documentation?

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

Re: ViewXY,IntensityGrid - Ranges

Post by ArctionPasi » Sun Feb 28, 2016 5:33 pm

Comments improved in v.7 related to this matter.
LightningChart Support Team, PT

Post Reply