i am begginer in vb6 .vb have a default code to sort pie chart in ascending or desecending order in mschart like
(mschart.plot.sort=(0 or 1 or 2)
i want the code to sort other charts in mschart for 2d,3d bar,2d,3d step,2d,3d line
eg: this is the code
Expand|Select|Wrap|Line Numbers
- Private Sub Combo1_Click()
- MSChart1.chartType = Combo1.ListIndex
- End Sub
- Private Sub Command1_Click()
- Dim X(1 To 10) As Integer
- If Val(Text1.Text) <= 1 Then
- MSChart1.Plot.SeriesCollection(1).Position.Excluded = True
- Else
- MSChart1.Plot.SeriesCollection(1).Position.Excluded = False
- X(1) = Val(Text1.Text)
- End If
- If Val(Text2.Text) <= 1 Then
- MSChart1.Plot.SeriesCollection(2).Position.Excluded = True
- Else
- MSChart1.Plot.SeriesCollection(2).Position.Excluded = False
- X(2) = Val(Text2.Text)
- End If
- If Val(Text3.Text) <= 1 Then
- MSChart1.Plot.SeriesCollection(3).Position.Excluded = True
- Else
- MSChart1.Plot.SeriesCollection(3).Position.Excluded = False
- X(3) = Val(Text3.Text)
- End If
- If Val(Text4.Text) <= 1 Then
- MSChart1.Plot.SeriesCollection(4).Position.Excluded = True
- Else
- MSChart1.Plot.SeriesCollection(4).Position.Excluded = False
- X(4) = Val(Text4.Text)
- End If
- If Val(Text5.Text) <= 1 Then
- MSChart1.Plot.SeriesCollection(5).Position.Excluded = True
- Else
- MSChart1.Plot.SeriesCollection(5).Position.Excluded = False
- X(5) = Val(Text5.Text)
- End If
- If Val(Text6.Text) <= 1 Then
- MSChart1.Plot.SeriesCollection(6).Position.Excluded = True
- Else
- MSChart1.Plot.SeriesCollection(6).Position.Excluded = False
- X(6) = Val(Text6.Text)
- End If
- If Val(Text7.Text) <= 1 Then
- MSChart1.Plot.SeriesCollection(7).Position.Excluded = True
- Else
- MSChart1.Plot.SeriesCollection(7).Position.Excluded = False
- X(7) = Val(Text7.Text)
- End If
- If Val(Text8.Text) <= 1 Then
- MSChart1.Plot.SeriesCollection(8).Position.Excluded = True
- Else
- MSChart1.Plot.SeriesCollection(8).Position.Excluded = False
- X(8) = Val(Text8.Text)
- End If
- If Val(Text9.Text) <= 1 Then
- MSChart1.Plot.SeriesCollection(9).Position.Excluded = True
- Else
- MSChart1.Plot.SeriesCollection(9).Position.Excluded = False
- X(9) = Val(Text9.Text)
- End If
- If Val(Text10.Text) <= 1 Then
- MSChart1.Plot.SeriesCollection(10).Position.Excluded = True
- Else
- MSChart1.Plot.SeriesCollection(10).Position.Excluded = False
- X(10) = Val(Text10.Text)
- End If
- X(1) = Val(Text1.Text)
- X(2) = Val(Text2.Text)
- X(3) = Val(Text3.Text)
- X(4) = Val(Text4.Text)
- X(5) = Val(Text5.Text)
- X(6) = Val(Text6.Text)
- X(7) = Val(Text7.Text)
- X(8) = Val(Text8.Text)
- X(9) = Val(Text9.Text)
- X(10) = Val(Text10.Text)
- MSChart1.ChartData = X
- MSChart1.chartType = VtChChartType2dPie
- MSChart1.Plot.Sort = VtSortTypeNone
- End Sub
- Private Sub ascend_Click()
- MSChart1.Plot.Sort = VtSortTypeAscending
- End Sub
- Private Sub descend_Click()
- MSChart1.Plot.Sort = VtSortTypeDescending
- End Sub
- Private Sub exit_Click()
- Form1.Hide
- End Sub
- Private Sub Form_Load()
- Dim X(1 To 10) As Integer
- With Combo1
- .AddItem "2D Step"
- .AddItem "3D Step"
- .AddItem "2D Line"
- .AddItem "3D Line"
- .AddItem "2D Area"
- .AddItem "3D Area"
- .AddItem "2D Combination"
- .AddItem "3D Combination"
- .AddItem "2D Bar"
- .AddItem "3D Bar"
- MSChart1.ChartData = X
- MSChart1.ColumnCount = 10
- MSChart1.RowCount = 1
- End With
- With MSChart1.Legend
- .Location.Visible = True
- .VtFont.Name = "Arial"
- .VtFont.Size = 8
- .Location.LocationType = VtChLocationTypeTop
- End With
- End Sub