Govardhanudu Gajula Ответов: 0

Удалите линию x y для графика в C sharp


private void Bindchart()

		{			
			DataTable ChartData = objJobPerReport.GetJobPerformanceGraph(new Guid(Session["ClientKey"].ToString()));

			Chart Chart1 = new Chart();
			int num_WeeklyPaidSubmits = 0;
			int num_WeeklyOrganicSubmits = 0;
			string[] XPointMember = new string[ChartData.Rows.Count];
			int[] YPointMemberOrganic = new int[ChartData.Rows.Count];
			int[] YPointMemberPaid = new int[ChartData.Rows.Count];

			for (int count = 0; count < ChartData.Rows.Count; count++)
			{
				XPointMember[count] = ChartData.Rows[count]["SubmitDate"].ToString();
				YPointMemberOrganic[count] = Convert.ToInt32(ChartData.Rows[count]["OrganicCount"]);
				YPointMemberPaid[count] = Convert.ToInt32(ChartData.Rows[count]["PaidCount"]);
				num_WeeklyOrganicSubmits += Convert.ToInt32(ChartData.Rows[count]["OrganicCount"]);
				num_WeeklyPaidSubmits += Convert.ToInt32(ChartData.Rows[count]["PaidCount"]);
			}
			lblTotalClicks.Text = num_WeeklyPaidSubmits.ToString();
			Chart1.Series.Add("Default").Points.AddY(1);
			Chart1.Series.Add("Default1").Points.AddY(1);
			Chart1.ChartAreas.Add("ChartArea1");
			Chart1.Series[0].ChartArea = "ChartArea1";	
			//Chart1.Series[0].ChartType = SeriesChartType.Bar;
			foreach (Series series in Chart1.Series)
			{
				series.ChartType = SeriesChartType.Bar;
			}
			Chart1.Series[0].MarkerStyle = MarkerStyle.Circle;
			Chart1.ChartAreas["ChartArea1"].AxisX.Minimum = 1;
			Chart1.ChartAreas["ChartArea1"].AxisX.LineWidth = 2;
			Chart1.ChartAreas["ChartArea1"].AxisX.LineColor = Color.Maroon;

			Chart1.Series[0].YAxisType = AxisType.Primary;
			Chart1.Series[1].YAxisType = AxisType.Secondary;
			Chart1.Series[0].Points.DataBindXY(XPointMember, YPointMemberPaid);
			Chart1.Series[1].Points.DataBindXY(XPointMember, YPointMemberOrganic);
			Chart1.Series[0].IsValueShownAsLabel = true;
			Chart1.Series[1].IsValueShownAsLabel = true;
			Chart1.Series[0].Color = Color.CadetBlue;
			Chart1.Series[0].BorderWidth = 2;
			Chart1.Series[0].LabelForeColor = Color.BlueViolet;
			Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;
			Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Interval = 0;
			Chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false;
			Chart1.ChartAreas[0].AxisY.Enabled = AxisEnabled.False;			
			Chart1.Width = 500;
			Chart1.Height = 200;
			//Chart1.ChartAreas[0].AxisX.IsMarginVisible = false;
			chartcontainer.Controls.Add(Chart1);
		}


Выше кода я получаю линию x y для диаграммы в c sharp, пожалуйста, дайте мне знать, как удалить их для диаграммы в c#

Что я уже пробовал:

private void Bindchart()

		{			
			DataTable ChartData = objJobPerReport.GetJobPerformanceGraph(new Guid(Session["ClientKey"].ToString()));

			Chart Chart1 = new Chart();
			int num_WeeklyPaidSubmits = 0;
			int num_WeeklyOrganicSubmits = 0;
			string[] XPointMember = new string[ChartData.Rows.Count];
			int[] YPointMemberOrganic = new int[ChartData.Rows.Count];
			int[] YPointMemberPaid = new int[ChartData.Rows.Count];

			for (int count = 0; count < ChartData.Rows.Count; count++)
			{
				XPointMember[count] = ChartData.Rows[count]["SubmitDate"].ToString();
				YPointMemberOrganic[count] = Convert.ToInt32(ChartData.Rows[count]["OrganicCount"]);
				YPointMemberPaid[count] = Convert.ToInt32(ChartData.Rows[count]["PaidCount"]);
				num_WeeklyOrganicSubmits += Convert.ToInt32(ChartData.Rows[count]["OrganicCount"]);
				num_WeeklyPaidSubmits += Convert.ToInt32(ChartData.Rows[count]["PaidCount"]);
			}
			lblTotalClicks.Text = num_WeeklyPaidSubmits.ToString();
			Chart1.Series.Add("Default").Points.AddY(1);
			Chart1.Series.Add("Default1").Points.AddY(1);
			Chart1.ChartAreas.Add("ChartArea1");
			Chart1.Series[0].ChartArea = "ChartArea1";	
			//Chart1.Series[0].ChartType = SeriesChartType.Bar;
			foreach (Series series in Chart1.Series)
			{
				series.ChartType = SeriesChartType.Bar;
			}
			Chart1.Series[0].MarkerStyle = MarkerStyle.Circle;
			Chart1.ChartAreas["ChartArea1"].AxisX.Minimum = 1;
			Chart1.ChartAreas["ChartArea1"].AxisX.LineWidth = 2;
			Chart1.ChartAreas["ChartArea1"].AxisX.LineColor = Color.Maroon;

			Chart1.Series[0].YAxisType = AxisType.Primary;
			Chart1.Series[1].YAxisType = AxisType.Secondary;
			Chart1.Series[0].Points.DataBindXY(XPointMember, YPointMemberPaid);
			Chart1.Series[1].Points.DataBindXY(XPointMember, YPointMemberOrganic);
			Chart1.Series[0].IsValueShownAsLabel = true;
			Chart1.Series[1].IsValueShownAsLabel = true;
			Chart1.Series[0].Color = Color.CadetBlue;
			Chart1.Series[0].BorderWidth = 2;
			Chart1.Series[0].LabelForeColor = Color.BlueViolet;
			Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Enabled = false;
			Chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.Interval = 0;
			Chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.Enabled = false;
			Chart1.ChartAreas[0].AxisY.Enabled = AxisEnabled.False;			
			Chart1.Width = 500;
			Chart1.Height = 200;
			//Chart1.ChartAreas[0].AxisX.IsMarginVisible = false;
			chartcontainer.Controls.Add(Chart1);
		}

Richard MacCutchan

Проверьте документацию для вашего класса диаграмм.

phil.o

Что такое линия x y- Ты говоришь об аксисе?

0 Ответов