mschart柱形图 怎样根据输入的值 显示一跟 水平线呢!1

解决方案 »

  1.   

    Dim arr(1 To 2, 1 To 3)
                        arr(1, 1) = "男"
                        arr(2, 1) = "女"
                        arr(1, 2) = rs2.RecordCount / rs1.RecordCount
                        arr(2, 2) = (rs1.RecordCount - rs2.RecordCount) / rs1.RecordCount
                        
                        MSChart1.ChartData = arr
                        MSChart1.Plot.SeriesCollection(1).LegendText = "男的比例(百分比)"
                        MSChart1.Plot.SeriesCollection(2).LegendText = "女的比例(百分比)"
                        lbl2.Caption = "男的比例是:" & Format((rs2.RecordCount / rs1.RecordCount), "#0.##%") & ""
                        lbl3.Caption = "女的比例是:" & Format(((rs1.RecordCount - rs2.RecordCount) / rs1.RecordCount), "#0.##%") & ""