我在我的网络表单中使用了microsoft Chart控件。我希望点(0,0)在图表上应该是粗体。我的代码如下:
DataTable dt = collection.ToDataTable();
// Chart1.Series[0].Points.DataBind(collection, "Price", "OverallQuality", "Label=HotelName");
for (int i = 0; i < dt.Rows.Count; i++)
{
Chart1.Series.Add("series" + i);
Chart1.Series["series" + i].ChartType = SeriesChartType.Point;
// Chart1.Series["series" + i].Points.AddXY(double.Parse(dt.Rows[i]["Price"].ToString()), double.Parse(dt.Rows[i]["OverallQuality"].ToString()));
Chart1.Series["series" + i].Points.AddXY(double.Parse(dt.Rows[i]["OverallQuality"].ToString()), double.Parse(dt.Rows[i]["Price"].ToString()));
Chart1.Series["series" + i].MarkerSize = 10;
Chart1.Series["series" + i].LegendText = dt.Rows[i]["HotelName"].ToString();
}
// Chart1.ChartAreas[0].AxisX.Title = "Price";
// Chart1.ChartAreas[0].AxisY.Title = "Quality";
Chart1.ChartAreas[0].AxisX.Title = "Quality";
Chart1.ChartAreas[0].AxisY.Title = "Price";
Chart1.ChartAreas[0].AxisX.Maximum = 10;
Chart1.ChartAreas[0].AxisX.Minimum = -10;
Chart1.ChartAreas[0].AxisX.Interval = 1;
Chart1.ChartAreas[0].AxisY.Maximum = 10;
Chart1.ChartAreas[0].AxisY.Minimum = -10;
Chart1.ChartAreas[0].AxisY.Interval = 1;
Chart1.ChartAreas[0].AxisX.MajorGrid.LineColor = System.Drawing.Color.LightGray;
Chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = System.Drawing.Color.LightGray;
}