Skip to content

Commit

Permalink
Merge pull request IDEMSInternational#864 from maxwellfundi/BarAndPie…
Browse files Browse the repository at this point in the history
…chartwork

Final Bar and Pie Chart including tabs order
  • Loading branch information
dannyparsons committed Feb 18, 2016
2 parents 885d5a4 + db7cda0 commit c5a377d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 41 deletions.
76 changes: 38 additions & 38 deletions instat/dlgBarAndPieChart.Designer.vb

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

33 changes: 30 additions & 3 deletions instat/dlgBarAndPieChart.vb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Imports instat.Translations
Public Class dlgBarAndPieChart
Private clsRggplotFunction As New RFunction
Private clsRgeom_barchart As New RFunction
Private clsRgeom_Piechart As New RFunction
Private clsRgeom_piechart As New RFunction
Private clsRgeom_piechartCoord As New RFunction
Private clsRaesFunction As New RFunction
Private Sub dlgBarAndPieChart_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ucrBase.clsRsyntax.SetOperation("+")
Expand All @@ -41,16 +42,42 @@ Public Class dlgBarAndPieChart
clsRggplotFunction.AddParameter("data", clsRFunctionParameter:=ucrBarChartSelector.ucrAvailableDataFrames.clsCurrDataFrame)
End Sub
Private Sub ucrFactorReceiver_Leave(sender As Object, e As EventArgs) Handles ucrFactorReceiver.Leave
clsRaesFunction.AddParameter("x", ucrFactorReceiver.GetVariableNames(False))
If rdoBarChart.Checked = True Then
clsRaesFunction.AddParameter("x", ucrFactorReceiver.GetVariableNames(False))
Else
clsRaesFunction.AddParameter("fill", ucrFactorReceiver.GetVariableNames(False))

End If
End Sub
Private Sub ucrSecondReceiver_Leave(sender As Object, e As EventArgs) Handles ucrSecondReceiver.Leave
clsRaesFunction.AddParameter("fill", ucrSecondReceiver.GetVariableNames(False))
If rdoBarChart.Checked = True Then
clsRaesFunction.AddParameter("fill", ucrSecondReceiver.GetVariableNames(False))
Else
clsRaesFunction.AddParameter("x", Chr(34) & Chr(34))
End If
End Sub

Private Sub grpSelection_CheckedChanged(sender As Object, e As EventArgs) Handles rdoBarChart.CheckedChanged, rdoPieChart.CheckedChanged
If rdoBarChart.Checked = True Then
clsRgeom_barchart.SetRCommand("geom_bar")
ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_barchart)

ElseIf rdoPieChart.Checked = True Then

Dim clsTempOp As New ROperator
Dim clsTempRFunc As New RFunction
clsTempOp.SetOperation("+")

clsRgeom_piechart.SetRCommand("geom_bar")
ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsRgeom_piechart)
clsRgeom_piechart.AddParameter("width", "1")

clsTempOp.SetParameter(True, clsRFunc:=clsRggplotFunction)
clsTempOp.SetParameter(False, clsRFunc:=clsRgeom_piechart)
clsTempRFunc.SetRCommand("coord_polar")
clsTempRFunc.AddParameter("theta", Chr(34) & "y" & Chr(34))
ucrBase.clsRsyntax.SetOperatorParameter(True, clsOp:=clsTempOp)
ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=clsTempRFunc)
Else
ucrBase.clsRsyntax.SetOperatorParameter(False, clsRFunc:=Nothing)
End If
Expand Down

0 comments on commit c5a377d

Please sign in to comment.