开发者

Bold points in Microsoft Chart control

I'm using microsoft Chart control in my web form. I want points(0, 0) should be bold on the chart. My code is as follows:

 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.S开发者_Python百科eries["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;
    }


Have you tried changing the PointWidth of the series?

Chart1.Series["series"]["PointWidth"] = "0.2"; 

You can find a bunch of examples of manipulating this property, such as this. But the trick, for your situation, is dealing with the fact that you can only manipulate this property for the entire series. This post leads me to believe you will have problems setting it for just this particular point, unless you can separate is into it's own somehow. Here's an exmample from stack somewhat similar that might help, depending on how your information is formatted.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜