Custom Major Ticks on NLogarithmicScaleConfigurator


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Mike,

The log transformation may be causing rounding errors. You can try a different approach and that is to use non tranformed log scale:

logScale.TransformScale = false;

In this mode you have to pass the custom ticks as normal values. Let us know if the problem persists - the other workaround will be to use a small explicit view range inflate...



Best Regards,
Nevron Support Team


Michael Hayford
Michael Hayford
Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)
Group: Forum Members
Posts: 14, Visits: 1
Here are the values I used:
-1.39794000867204
-0.176906939203039
1.04412613026596
2.26515919973496
3.07918124604763
Note that the LogScaleConfigurator needs to be passed the log of the values for the custom tick values. Maybe this is a problem?

Thanks

Mike
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi Michael,

Can you post the exact values you pass for custom ticks - we were not able to reproduce the problem with random values...



Best Regards,
Nevron Support Team


Michael Hayford
Michael Hayford
Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)Junior Member (14 reputation)
Group: Forum Members
Posts: 14, Visits: 1
I have a problem I'm trying to solve and haven't come up with the right set of property settings. I have a NLogarithmicScaleConfigurator and I want to set major tick marks are specific values, including the beginning and end of the range. The beginning tick mark always shows up, but the ending one does sometimes and not others. This doesn't seem to be a problem with a NNumericScaleConfigurator. I've added two screen captures showing the problem.

Some of the relevant code I'm using is pasted below. I can send a test program if needed.

If logScale Then
scale = New NLogarithmicScaleConfigurator
scale.AutoMinorTicks = True
scale.MinorTickCount = 3
Else
scale = New NLinearScaleConfigurator
scale.AutoMinorTicks = False
End If

scale.AutoLabels = True

scale.InnerMinorTickStyle.Length = New NLength(0, NGraphicsUnit.Point)
scale.InnerMajorTickStyle.Length = New NLength(0, NGraphicsUnit.Point)

scale.OuterMinorTickStyle.Length = New NLength(2, NGraphicsUnit.Point)
scale.OuterMinorTickStyle.Offset = New NLength(0, NGraphicsUnit.Point)
scale.OuterMajorTickStyle.Length = New NLength(4, NGraphicsUnit.Point)
scale.OuterMajorTickStyle.Offset = New NLength(0, NGraphicsUnit.Point)

scale.MajorTickMode = MajorTickMode.CustomTicks
scale.CustomMajorTicks.Clear()
scale.CustomMinorTicks.Clear()
scale.LabelStyle.ContentAlignment = ContentAlignment.TopCenter
scale.LabelStyle.VisibilityMode = ScaleLabelVisibilityMode.Always
scale.InflateViewRangeBegin = False
scale.InflateViewRangeEnd = False
scale.DisplayFirstLabel = True
scale.DisplayLastLabel = True

' Prevent the labels from being staggered, which doesn't work very well.
scale.LabelFitModes = New LabelFitMode() {LabelFitMode.RemoveOverlap}
scale.CreateNewLevelForCustomLabels = False

Thanks for any insight or suggestions you could give me.

Mike
Attachments
LogLegend.PNG (72 views, 21.00 KB)
LinearLegend.PNG (76 views, 21.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search