投稿日 | : 2003/09/12(Fri) 16:34 |
投稿者 | : ちゅら |
Eメール | : |
URL | : |
タイトル | : Re^4: これではどうですか? |
ありがとうございます。
実行するとコマンドボタンが消えてしまうのですが、どうすれば解決するでしょうか??
Option Explicit
Private intChartType As Integer 'グラフの種類
Private intDat(10, 2) As Long '数値
Private Sub sChartViewSet()
Dim series As Object
If intChartType = 1 Then
'散布図(プロット)
With MSChart1
'グラフタイプを散布図に設定
.Plot.UniformAxis = False 'グラフを横長に
.chartType = VtChChartType2dXY
End With
'すべての系列についてマーカーを表示し、線を表示解除します。
For Each series In _
MSChart1.Plot.SeriesCollection
series.SeriesMarker.Show = True
series.ShowLine = False
Next
Else
'散布図(ライン)
With MSChart1
'グラフタイプを散布図に設定
.chartType = VtChChartType2dXY
.Plot.UniformAxis = False 'グラフを横長に
End With
'すべての系列についてマーカーを非表示し、線を表示します。
For Each series In MSChart1.Plot.SeriesCollection
series.SeriesMarker.Show = False
series.ShowLine = True
Next
End If
End Sub
Private Sub Command1_Click()
'ライン表示のメニュ
intChartType = 0
Call sChartViewSet
End Sub
Private Sub Command2_Click()
'プロット表示のメニュ
intChartType = 1
Call sChartViewSet
End Sub
Private Sub sDataOpen()
'CSVファイルから2行10列のデータを読込み
Dim CsvD(10) As String, j As Long
Dim intDatN As Integer, intFileNo As Integer
intFileNo = FreeFile
Open "C:\Documents and Settings\admin\デスクトップ\omosako\Book2.csv" For Input As #intFileNo
intDatN = -1
With MSChart1
.chartType = VtChChartType2dBar
.ColumnCount = 2
.RowCount = 10
Do Until EOF(intFileNo)
intDatN = intDatN + 1
Input #intFileNo, CsvD(0), CsvD(1), CsvD(2), CsvD(3), CsvD(4), _
CsvD(5), CsvD(6), CsvD(7), CsvD(8), CsvD(9)
.Column = intDatN + 1
For j = 0 To 9
.Row = j + 1
.Data = CInt(CsvD(j))
Next j
Loop
Close #intFileNo
End With
End Sub
Private Sub Form_Load()
Form1.Move 0, 0, 10400, 7000
MSChart1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
Call sDataOpen
intChartType = 1
Call sChartViewSet
End Sub
Private Sub Form_Resize()
MSChart1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End Sub