473,396 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

sort 2d bar chart in ascending or descending order in ms chart

very urgent help me
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
  1. Private Sub Combo1_Click()
  2. MSChart1.chartType = Combo1.ListIndex
  3. End Sub
  4. Private Sub Command1_Click()
  5. Dim X(1 To 10) As Integer
  6. If Val(Text1.Text) <= 1 Then
  7. MSChart1.Plot.SeriesCollection(1).Position.Excluded = True
  8. Else
  9. MSChart1.Plot.SeriesCollection(1).Position.Excluded = False
  10. X(1) = Val(Text1.Text)
  11. End If
  12. If Val(Text2.Text) <= 1 Then
  13. MSChart1.Plot.SeriesCollection(2).Position.Excluded = True
  14. Else
  15. MSChart1.Plot.SeriesCollection(2).Position.Excluded = False
  16. X(2) = Val(Text2.Text)
  17. End If
  18. If Val(Text3.Text) <= 1 Then
  19. MSChart1.Plot.SeriesCollection(3).Position.Excluded = True
  20. Else
  21. MSChart1.Plot.SeriesCollection(3).Position.Excluded = False
  22. X(3) = Val(Text3.Text)
  23. End If
  24. If Val(Text4.Text) <= 1 Then
  25. MSChart1.Plot.SeriesCollection(4).Position.Excluded = True
  26. Else
  27. MSChart1.Plot.SeriesCollection(4).Position.Excluded = False
  28. X(4) = Val(Text4.Text)
  29. End If
  30. If Val(Text5.Text) <= 1 Then
  31. MSChart1.Plot.SeriesCollection(5).Position.Excluded = True
  32. Else
  33. MSChart1.Plot.SeriesCollection(5).Position.Excluded = False
  34. X(5) = Val(Text5.Text)
  35. End If
  36. If Val(Text6.Text) <= 1 Then
  37. MSChart1.Plot.SeriesCollection(6).Position.Excluded = True
  38. Else
  39. MSChart1.Plot.SeriesCollection(6).Position.Excluded = False
  40. X(6) = Val(Text6.Text)
  41. End If
  42. If Val(Text7.Text) <= 1 Then
  43. MSChart1.Plot.SeriesCollection(7).Position.Excluded = True
  44. Else
  45. MSChart1.Plot.SeriesCollection(7).Position.Excluded = False
  46. X(7) = Val(Text7.Text)
  47. End If
  48. If Val(Text8.Text) <= 1 Then
  49. MSChart1.Plot.SeriesCollection(8).Position.Excluded = True
  50. Else
  51. MSChart1.Plot.SeriesCollection(8).Position.Excluded = False
  52. X(8) = Val(Text8.Text)
  53. End If
  54. If Val(Text9.Text) <= 1 Then
  55. MSChart1.Plot.SeriesCollection(9).Position.Excluded = True
  56. Else
  57. MSChart1.Plot.SeriesCollection(9).Position.Excluded = False
  58. X(9) = Val(Text9.Text)
  59. End If
  60. If Val(Text10.Text) <= 1 Then
  61. MSChart1.Plot.SeriesCollection(10).Position.Excluded = True
  62. Else
  63. MSChart1.Plot.SeriesCollection(10).Position.Excluded = False
  64. X(10) = Val(Text10.Text)
  65. End If
  66. X(1) = Val(Text1.Text)
  67. X(2) = Val(Text2.Text)
  68. X(3) = Val(Text3.Text)
  69. X(4) = Val(Text4.Text)
  70. X(5) = Val(Text5.Text)
  71. X(6) = Val(Text6.Text)
  72. X(7) = Val(Text7.Text)
  73. X(8) = Val(Text8.Text)
  74. X(9) = Val(Text9.Text)
  75. X(10) = Val(Text10.Text)
  76. MSChart1.ChartData = X
  77. MSChart1.chartType = VtChChartType2dPie
  78. MSChart1.Plot.Sort = VtSortTypeNone
  79. End Sub
  80.  
  81. Private Sub ascend_Click()
  82. MSChart1.Plot.Sort = VtSortTypeAscending
  83. End Sub
  84.  
  85. Private Sub descend_Click()
  86. MSChart1.Plot.Sort = VtSortTypeDescending
  87. End Sub
  88.  
  89. Private Sub exit_Click()
  90. Form1.Hide
  91. End Sub
  92.  
  93. Private Sub Form_Load()
  94. Dim X(1 To 10) As Integer
  95. With Combo1
  96. .AddItem "2D Step"
  97. .AddItem "3D Step"
  98. .AddItem "2D Line"
  99. .AddItem "3D Line"
  100. .AddItem "2D Area"
  101. .AddItem "3D Area"
  102. .AddItem "2D Combination"
  103. .AddItem "3D Combination"
  104. .AddItem "2D Bar"
  105. .AddItem "3D Bar"
  106. MSChart1.ChartData = X
  107. MSChart1.ColumnCount = 10
  108. MSChart1.RowCount = 1
  109. End With
  110.  
  111. With MSChart1.Legend
  112.   .Location.Visible = True
  113.   .VtFont.Name = "Arial"
  114.   .VtFont.Size = 8
  115.   .Location.LocationType = VtChLocationTypeTop
  116. End With
  117. End Sub
Jan 20 '13 #1
0 1390

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Talis | last post by:
I have a reasonably large table (over 2 million rows) and my select results need to be sorted in descending order. I've noticed, however, that my queries ORDER'ed by DESC are at least twice as...
2
by: Luigi Napolitano | last post by:
Hello, I use this algorithm to sort an array "v" in the descending order. void quickSort(float v, int lo0, int hi0) { int lo = lo0; int hi = hi0; if (lo >= hi) return; float mid = v;
3
by: Leszek | last post by:
Hello, I guess it should be easy. I need to iterate through the XML node list using foreach in descending order: string XML_DOCUMENT = Server.MapPath("members.xml"); XmlDocument myXmlDoc =...
4
by: Newbie | last post by:
i am able to allow the user to sort the columns of my datagrid, but only in ascending order. is there a way to allow sorting in descending order? thanks in advance. private void Page_Load(object...
1
by: Mark | last post by:
Rather than have only one column sorted in a single direction in a listview. I would like to be able to sort on any column in alternating directions (ascending,descending) eg. First column click...
2
by: phillip.s.powell | last post by:
SELECT s.id, s.first_name, s.last_name, IF(s.school_year_id = 0, s.school_year_other, y.school_year_alt_display) AS school_year_name FROM student s LEFT OUTER JOIN school_year y ON...
2
by: Richard Hollenbeck | last post by:
I have the following query in a combo box: SELECT courses.courseCode, courses.courseDescription FROM courses ORDER BY courseDescription; I want to change the "ORDER BY" to display in...
5
by: subramanian100in | last post by:
In the ISO document www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf in the detail of the qsort library function in 7.20.5.2, the description says that, the contents of the array are sorted...
0
by: ravikim1 | last post by:
Hi , use Sort::External; $output = '1.txt'; open(FILE, $output); my $sortex = Sort::External->new( mem_threshold => 1024**2 * 1024 ); while (<FILE>) { $sortex->feed($_); # tried to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.