2016-06-01 5 views
0

私は設定グリッド線種

Chart1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.Dash; 
Chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash; 

を試みたが、動作していません。

チャートコントロールを設定するためのコードは次のとおりです。LineDashStyleの設定後、グリッド線が広くなります。ここで

Chart1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.DashDotDot; 
Chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash; 
Chart1.ChartAreas[0].AxisX.MajorTickMark.Enabled = false; 
Chart1.ChartAreas[0].AxisY.MajorTickMark.Enabled = false; 
Chart1.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount; 
Chart1.ChartAreas[0].AxisX.MajorGrid.Interval = 3600; 
Chart1.ChartAreas[0].AxisX.Interval = 3600; 
Chart1.ChartAreas[0].AxisX.Maximum = 3600 * ((int)m/3600 + 1); 
Chart1.ChartAreas[0].AxisX.Minimum = 0; 
Chart1.Series.Add("Latitude"); 
Chart1.ChartAreas[0].AxisX.Title = "Epoch[h]"; 
Chart1.ChartAreas[0].AxisX.TitleFont = new Font("TimesNewRoman", 10); 
Chart1.ChartAreas[0].Position.Width = 45; 
Chart1.ChartAreas[0].Position.Height = 30; 
Chart1.Series[0].ChartType = SeriesChartType.Line; 
Chart1.Series[0].Points.DataBindXY(time,rms_x); 
Chart1.ChartAreas[0].AxisY.Title = "Latitude[m]"; 
Chart1.ChartAreas[0].AxisY.TitleFont = new Font("TimesNewRoman", 10); 
Chart1.ChartAreas[0].AxisX.LabelStyle.IsStaggered = false; 

//Chart1.ChartAreas[0].AxisX.LabelStyle.Interval = 1; 
Chart1.ChartAreas[0].Name = "Latitude"; 
Chart1.ChartAreas[0].Position.X = 0; 
Chart1.ChartAreas[0].Position.Y = 0; 
Chart1.Series[0].ChartArea = "Latitude"; 

は私がgot.'LinshDashStyle絵は」最初の図にダッシュと2番目の図は、更新前にあるために更新されています。

enter image description here

+0

詳細情報を提供できますか?エラーは表示されますか?いつLineDashStyleを更新しようとしていますか? –

+0

はい、グリッド線が広くなります。完全なコードを投稿しました。 –

+2

最初の2行のコードは__ works just fine__!それがあなたのためでなければ、それをリセットする他のコードがなければなりません。それがそうであるように、それはまさにそれが想定されるものです。あなたは何を得るの画像を投稿してください! – TaW

答えて

0

コードに最後の行を追加してみてください、私達に結果を伝えます。

Chart1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.Dash; 
Chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash; 
Chart1.ChartAreas[0].BorderDashStyle = ChartDashStyle.Dash; 
+0

効果がなく、効果がありませんでした。 –

1
txt_Report.Text += ts.ReadData(textBox1.Text, isChecked); 
txt_Report.Text += ts.DrawGraph(chart1, textBox1.Text, isChecked); 

回答やコメントのすべてのおかげで、私はfinnaly、私はその性質が理由で設定するオブジェクトにチャートを渡されたことがわかりました。

関連する問題