Skip to content

Commit

Permalink
Merge pull request IDEMSInternational#9202 from derekagorhom/Bug_fixe…
Browse files Browse the repository at this point in the history
…s_Line_Plot

Fixed Legend position option in the Line graph > slope option
  • Loading branch information
N-thony authored Nov 5, 2024
2 parents e442bc5 + 77ed587 commit 9bd2f3f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 37 deletions.
12 changes: 0 additions & 12 deletions instat/dlgLinePlot.designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 20 additions & 25 deletions instat/dlgLinePlot.vb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Public Class dlgLinePlot
Dim dctColourOptions As New Dictionary(Of String, String)
Dim dctSlopeLineColourOptions As New Dictionary(Of String, String)
Dim dctLegendPosition As New Dictionary(Of String, String)
Dim dctSlopePosition As New Dictionary(Of String, String)

ucrBase.clsRsyntax.bExcludeAssignedFunctionOutput = False
ucrBase.clsRsyntax.iCallType = 3
Expand Down Expand Up @@ -393,10 +394,6 @@ Public Class dlgLinePlot
ucrChkSlopeLineOptions.AddParameterPresentCondition(True, "line_colour")
ucrChkSlopeLineOptions.AddParameterPresentCondition(False, "line_colour", False)

ucrChkSlopeLegend.SetText("Legend")
ucrChkSlopeLegend.AddParameterPresentCondition(True, "slopetheme")
ucrChkSlopeLegend.AddParameterPresentCondition(False, "slopetheme", False)

ucrChkLegend.SetText("Legend:")
ucrChkLegend.AddToLinkedControls({ucrInputLegendPosition}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="None")
ucrInputLegendPosition.SetDropDownStyleAsNonEditable()
Expand Down Expand Up @@ -433,7 +430,7 @@ Public Class dlgLinePlot
ucrPnlOptions.AddToLinkedControls({ucrReceiverSlopeY}, {rdoDumbbell, rdoSlope, rdoLinerange}, bNewLinkedHideIfParameterMissing:=True)
ucrPnlOptions.AddToLinkedControls({ucrReceiverX}, {rdoLine, rdoDumbbell, rdoSmoothing, rdoLinerange}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrPnlOptions.AddToLinkedControls({ucrVariablesAsFactorForLinePlot}, {rdoLine, rdoSmoothing}, bNewLinkedHideIfParameterMissing:=True)
ucrPnlOptions.AddToLinkedControls({ucrReceiverSlopeX, ucrReceiverSlopeColour, ucrChkSlopeLabelOptions, ucrChkSlopeTextOptions, ucrChkSlopeLineOptions, ucrChkSlopeLegend}, {rdoSlope}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrPnlOptions.AddToLinkedControls({ucrReceiverSlopeX, ucrReceiverSlopeColour, ucrChkSlopeLabelOptions, ucrChkSlopeTextOptions, ucrChkSlopeLineOptions}, {rdoSlope}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrPnlOptions.AddToLinkedControls({ucrReceiverYMax, ucrChkAddLineLineRange, ucrReceiverYMin, ucrChkRibbon}, {rdoLinerange}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrChkDumbbellColour.AddToLinkedControls({ucrInputDumbbellX}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedUpdateFunction:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Orange")
ucrChkDumbbellColour.AddToLinkedControls({ucrInputDumbbellXEnd}, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True, bNewLinkedUpdateFunction:=True, bNewLinkedChangeToDefaultState:=True, objNewDefaultState:="Blue")
Expand Down Expand Up @@ -667,8 +664,7 @@ Public Class dlgLinePlot
ucrChkSlopeLabelOptions.SetRCode(clsGgSlopeFunction, bReset)
ucrChkSlopeTextOptions.SetRCode(clsGgSlopeFunction, bReset)
ucrChkSlopeLineOptions.SetRCode(clsGgSlopeFunction, bReset)
ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True)
ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True)

If bReset Then
ucrInputMethod.SetRCode(clsGeomSmoothFunction, bReset)
ucrChkRibbon.SetRCode(clsBaseOperator, bReset)
Expand All @@ -678,6 +674,8 @@ Public Class dlgLinePlot
ucrChkAddLineLineRange.SetRCode(clsBaseOperator, bReset)
ucrChkAddLine.SetRCode(clsBaseOperator, bReset)
ucrChkSpan.SetRCode(clsGeomSmoothFunction, bReset)
ucrChkLegend.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True)
ucrInputLegendPosition.SetRCode(clsThemeFunction, bReset, bCloneIfNeeded:=True)
End If
SetGroupParam()
End Sub
Expand Down Expand Up @@ -801,7 +799,6 @@ Public Class dlgLinePlot
AddRemoveFormula()
AddRemoveGeomLine()
AddRemoveLineRange()
AddRemoveSlopeGraph()
AddRemoveMethodArgs()
AddRemoveLine()
AddRemoveSE()
Expand Down Expand Up @@ -858,9 +855,22 @@ Public Class dlgLinePlot
End Sub

Private Sub ucrChkLegend_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkLegend.ControlValueChanged, ucrInputLegendPosition.ControlValueChanged
AddRemoveTheme()
If rdoSlope.Checked Then
If ucrChkLegend.Checked Then
clsBaseOperator.AddParameter("theme", clsRFunctionParameter:=clsThemeFunction, iPosition:=-1)
clsThemeFunction.AddParameter("legend.position", Chr(34) & ucrInputLegendPosition.GetValueToSet & Chr(34), iPosition:=1)
clsBaseOperator.RemoveParameterByName("c")
Else
clsBaseOperator.RemoveParameterByName("theme")
clsBaseOperator.RemoveParameterByName("slopetheme")
End If
End If
If rdoLine.Checked OrElse rdoLinerange.Checked OrElse rdoSmoothing.Checked OrElse rdoDumbbell.Checked Then
AddRemoveTheme()
End If
End Sub


Private Sub cmdOptions_Click(sender As Object, e As EventArgs) Handles cmdOptions.Click, PlotOptionsToolStripMenuItem.Click
sdgPlots.SetRCode(clsNewOperator:=ucrBase.clsRsyntax.clsBaseOperator, clsNewYScalecontinuousFunction:=clsYScalecontinuousFunction, clsNewXScalecontinuousFunction:=clsXScalecontinuousFunction,
clsNewXLabsTitleFunction:=clsXlabsFunction, clsNewYLabTitleFunction:=clsYlabFunction, clsNewLabsFunction:=clsLabsFunction, clsNewFacetFunction:=clsRFacetFunction,
Expand Down Expand Up @@ -1193,22 +1203,6 @@ Public Class dlgLinePlot
AddRemoveLineRange()
End Sub

Private Sub AddRemoveSlopeGraph()
If rdoSlope.Checked Then
If ucrChkSlopeLegend.Checked Then
clsBaseOperator.RemoveParameterByName("slopetheme")
Else
clsBaseOperator.AddParameter("slopetheme", clsRFunctionParameter:=clsSlopeThemeFunction, iPosition:=-1)
End If
Else
clsBaseOperator.RemoveParameterByName("slopetheme")
End If
End Sub

Private Sub ucrChkSlopeLegend_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkSlopeLegend.ControlValueChanged
AddRemoveSlopeGraph()
End Sub

Private Sub AddRemoveLine()
If rdoSmoothing.Checked Then
If ucrChkAddLine.Checked Then
Expand Down Expand Up @@ -1278,4 +1272,5 @@ Public Class dlgLinePlot
Private Sub ucrChkAddLineLineRange_ControlValueChanged(ucrChangedControl As ucrCore) Handles ucrChkAddLineLineRange.ControlValueChanged
AddRemoveLineOnLineRange()
End Sub

End Class

0 comments on commit 9bd2f3f

Please sign in to comment.