Page 1 of 1
AxisValueType.MapCoordsDegMinSecNESW and 180 Deg Longitude
Posted: Fri Jun 21, 2019 8:38 pm
by JamesD
I'm plotting a 3D section of the ocean floor, with axes X, Z, Y = Longitude, Latitude, and Depth respectively. X and Z are defined:
Code: Select all
// Setup X-Axis as Longitude
_chart.View3D.XAxisPrimary3D.ValueType = AxisValueType.MapCoordsDegMinSecNESW;
_chart.View3D.XAxisPrimary3D.Title.Text = "Longitude";
// Setup Z-Axis as Latitude
_chart.View3D.ZAxisPrimary3D.ValueType = AxisValueType.MapCoordsDegMinSecNESW;
_chart.View3D.ZAxisPrimary3D.Title.Text = "Latitude";
When NOT crossing the International Date Line (Longitude = 180) everything looks fine:
- Center_62.5_N175.jpg (139.13 KiB) Viewed 17788 times
- Center_62.5_N175_Code.jpg (381.09 KiB) Viewed 17788 times
But when crossing the IDL, eg Westmost = 175 to Eastmost = -175, the X-axis labels and values don't follow:
- Center_62.5_180.jpg (173.77 KiB) Viewed 17788 times
Any suggestions?
Re: AxisValueType.MapCoordsDegMinSecNESW and 180 Deg Longitu
Posted: Fri Jun 21, 2019 8:39 pm
by JamesD
Here's the final screen shot since a max of three per post is allowed:
- Center_62.5_180_Code.jpg (382.58 KiB) Viewed 17787 times
Re: AxisValueType.MapCoordsDegMinSecNESW and 180 Deg Longitu
Posted: Tue Jun 25, 2019 11:46 am
by Arction_LasseP
Hello James,
We investigated this issue and found out currently there is no setting, which allows the map coordinates to behave correctly when crossing the International Date Line. Technically this requires the axis ranges to be something like
175->180->-180->-175 which is not possible. Instead, the axis values are automatically switched so that minimum is always smaller than maximum. This feature is something we could fix/change in the future.
There is a workaround that could help here: using custom axis ticks. For example:
Code: Select all
private int east = -175, west = 175;
_chart.View3D.XAxisPrimary3D.SetRange(west, east); // This will be switched so that minimum is -175 and maximum 175
_chart.View3D.XAxisPrimary3D.ValueType = AxisValueType.MapCoordsDegMinSecNESW;
_chart.View3D.XAxisPrimary3D.Title.Text = "Longitude";
_chart.View3D.XAxisPrimary3D.AutoFormatLabels = false; // Custom ticks might not work correctly with AutoFormatLabels enabled
_chart.View3D.XAxisPrimary3D.CustomTicksEnabled = true;
_chart.View3D.XAxisPrimary3D.CustomTicks.Add(new CustomAxisTick(_chart.View3D.XAxisPrimary3D, -175, "175°0'0\"E"));
_chart.View3D.XAxisPrimary3D.CustomTicks.Add(new CustomAxisTick(_chart.View3D.XAxisPrimary3D, -70, "178°0'0\"E"));
_chart.View3D.XAxisPrimary3D.CustomTicks.Add(new CustomAxisTick(_chart.View3D.XAxisPrimary3D, 0, "IDL"));
_chart.View3D.XAxisPrimary3D.CustomTicks.Add(new CustomAxisTick(_chart.View3D.XAxisPrimary3D, 70, "178°0'0\"W"));
_chart.View3D.XAxisPrimary3D.CustomTicks.Add(new CustomAxisTick(_chart.View3D.XAxisPrimary3D, 175, "175°0'0\"W"));
_chart.View3D.XAxisPrimary3D.InvalidateCustomTicks();
You could for instance check if Westmost -value is larger than Eastmost. If this is true, enable custom ticks, otherwise keep them disabled. You might also need to solve how to convert axis values to correct longitude values.
Hope this is helpful.
Re: AxisValueType.MapCoordsDegMinSecNESW and 180 Deg Longitu
Posted: Thu Jun 27, 2019 12:34 pm
by JamesD
Thanks, I'll give it a try and see what I can do...