掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
VB2010 Chartでの表示と収得の方法? (ID:147847)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
shuさん、ありがとうございます。 >Q1,Q3に関するサンプル Q3は解決しました。ありがとうございます。 Q1ですが、日付優先ではなくデータ優先なのです。 質問の仕方が悪くてすみません。少しサンプルを変更させて頂きました。 Q,特定の日付を指定して表示、他の日付は非表示にすることは可能でしょうか? >Q2はChart.Hittestで出来るのではないでしょうか。 得られた座標から該当のローソク足が特定できれば出来るような気がします。 お教えのほどよろしくお願いします。 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'データの取得 Dim tbl As New DataTable '列の作成 With tbl.Columns .Add("日付", GetType(String)) .Add("高値", GetType(Integer)) .Add("安値", GetType(Integer)) .Add("始値", GetType(Integer)) .Add("終値", GetType(Integer)) .Add("指数1", GetType(Integer)) End With 'データの追加 tbl.Rows.Add("2012/08/1", 700, 500, 600, 550, 500) tbl.Rows.Add("2012/08/2", 1100, 800, 850, 800, DBNull.Value) tbl.Rows.Add("2012/08/7", 800, 500, 700, 750, 600) tbl.Rows.Add("2012/08/8", 800, 500, 300, 600, 400) 'tbl.Rows.Add({#8/31/2012#, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value}) '初期化 Chart1.Series.Clear() 'Chartコントロールにタイトルを設定 Chart1.Titles.Add("株価 日足") With Chart1.ChartAreas(0).AxisX .MajorGrid.Enabled = False 'Chart1.ChartAreas(0).AxisX.MajorGrid.Enabled = False .MinorGrid.Enabled = False 'Chart1.ChartAreas(0).AxisX.MinorGrid.Enabled = False '.Minimum = #8/1/2012#.Subtract(#1/1/1900#).TotalDays + 1 '.Maximum = .Minimum + 31 '.Interval = 7 '.IntervalAutoMode = DataVisualization.Charting.IntervalAutoMode.VariableCount End With 'グラフの種類,系列,軸の設定 Dim rosoku = Chart1.Series.Add("ローソク足") With rosoku .ChartType = DataVisualization.Charting.SeriesChartType.Candlestick .XValueMember = "日付" .YValueMembers = "高値, 安値, 始値, 終値" .IsVisibleInLegend = False End With ' Dim ore1 = Chart1.Series.Add("折れ線1") With ore1 .ChartType = DataVisualization.Charting.SeriesChartType.Line .XValueMember = "日付" .YValueMembers = "指数1" .IsVisibleInLegend = False End With Chart1.DataSource = tbl Chart1.DataBind() End Sub 'マウスをクリック時の処理 ?? Private Sub Chart1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Chart1.Click '?? End Sub 'X,Y 座標を求める ?? Private Function Coordinates(ByVal x As Integer, ByVal y As Integer) As CoordinatesResult '?? End Function
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.