Profile Picture

Log Log axis titles

Posted By Warwick Payten 12 Years Ago
Author
Message
Warwick Payten
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 5, Visits: 1

Hi  All

I have a log-log plot, I have simplified to the following code. While both x and y axis titles are set. Both axis titles end up with the X title  (last one instanced )???

Thanks in advanced

Warwick

 

        m_Chart3 = NChartControl3.Charts(0)
        m_line7 = CType(m_Chart3.Series.Add(SeriesType.Line), NLineSeries)
        Dim axisy As NAxis = m_Chart3.Axis(StandardAxis.PrimaryY)
        Dim axisx As NAxis = m_Chart3.Axis(StandardAxis.PrimaryX)
        Dim linearScale As NLinearScaleConfigurator = New NLinearScaleConfigurator()

         m_Chart3.BoundsMode = BoundsMode.Stretch

        Dim I As Integer
        Dim InteractionC As Double
        Dim InteractionF As Double
        Dim inc As Double
        inc = 0.01
        InteractionC = 0
        InteractionF = 1
        For I = 1 To 99
            InteractionC = InteractionC + inc
            InteractionF = InteractionF - inc
            m_line7.AddDataPoint(New NDataPoint(InteractionC, InteractionF))
        Next
      
        m_line7.UseXValues = True
        m_line7.DataLabelStyle.Visible = False
        m_line7.MarkerStyle.Visible = False
        m_line7.Name = "Crack Initiation Envelope"
        m_line7.BorderStyle.Color = Color.Black
        m_line7.BorderStyle.Width = New NLength(2, NGraphicsUnit.Pixel)

        Dim primaryY As NAxis = m_Chart3.Axis(StandardAxis.PrimaryY)
        Dim primaryX As NAxis = m_Chart3.Axis(StandardAxis.PrimaryX)

        Dim logscale As New NLogarithmicScaleConfigurator
        primaryY.ScaleConfigurator = logscale
        primaryX.ScaleConfigurator = logscale

        axisy.View = New NRangeAxisView(New NRange1DD(0.01, 10))
        axisx.View = New NRangeAxisView(New NRange1DD(0.01, 10))

        Dim scaleConfiguratorx As NScaleConfigurator = primaryX.ScaleConfigurator
        scaleConfiguratorx.Title.Text = "Creep Damage Dc"

        Dim scaleConfiguratory As NScaleConfigurator = primaryY.ScaleConfigurator
        scaleConfiguratory.Title.Text = "Fatigue Damage Df"

        NChartControl3.Refresh()



Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 8:46 AM
Posts: 3,054, Visits: 4,012

Hi Warwick,

You have a small bug in the code:

Dim logscale As New NLogarithmicScaleConfigurator
primaryY.ScaleConfigurator = logscale
primaryX.ScaleConfigurator = logscale

axisy.View = New NRangeAxisView(New NRange1DD(0.01, 10))
axisx.View = New NRangeAxisView(New NRange1DD(0.01, 10))

Dim scaleConfiguratorx As NScaleConfigurator = primaryX.ScaleConfigurator
scaleConfiguratorx.Title.Text = "Creep Damage Dc"

Dim scaleConfiguratory As NScaleConfigurator = primaryY.ScaleConfigurator
scaleConfiguratory.Title.Text = "Fatigue Damage Df"

NChartControl3.Refresh()

should be:

primaryY.ScaleConfigurator = New NLogarithmicScaleConfigurator
primaryX.ScaleConfigurator = New NLogarithmicScaleConfigurator

axisy.View = New NRangeAxisView(New NRange1DD(0.01, 10))
axisx.View = New NRangeAxisView(New NRange1DD(0.01, 10))

Dim scaleConfiguratorx As NScaleConfigurator = primaryX.ScaleConfigurator
scaleConfiguratorx.Title.Text = "Creep Damage Dc"

Dim scaleConfiguratory As NScaleConfigurator = primaryY.ScaleConfigurator
scaleConfiguratory.Title.Text = "Fatigue Damage Df"

NChartControl3.Refresh()

Otherwise both axes share the same scale configurator and you get the last assigned title....



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic