Tag: 饼图

如何将图表类型设置为饼图

当我这样做而没有把图表类型工作正常,但当我把它设置为馅饼时它的工作不正确。 它将所有系列名称作为Point 1,馅饼只有1个蓝色部分(一个圆圈),它只显示第一个点(Value)。 foreach (var tag in tags) { HtmlNode tagname = tag.SelectSingleNode(“a”); HtmlNode tagcount = tag.SelectSingleNode(“span/span”); chart1.Series.Add(tagname.InnerText); chart1.Series[x].Points.AddY(int.Parse(tagcount.InnerText)); chart1.Series[x].IsValueShownAsLabel = true; chart1.Series[x].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie; x++; }

更改asp图表图例标签宽度

ASPX 代码背后 Chart1.Titles.Add(new Title(“Completed/Pending Count Anaysis”,Docking.Top,new Font(“Verdana”, 12f, FontStyle.Bold),Color.Black)); Chart1.Series[0].XValueMember = “COLUMN_NAME”; Chart1.Series[0].YValueMembers = “H_COUNT”; Chart1.Series[0].ChartType = SeriesChartType.Pie; Chart1.Series[0].IsValueShownAsLabel = false; Chart1.Series[0].Label = “#PERCENT”; Chart1.Series[0].LabelFormat = “{0:0%}”; Chart1.Series[0].LegendText = “#VALX #PERCENT{P2}”; Chart1.Series[“Series1”][“PieLabelStyle”] = “outside”; Chart1.Series[0][“PieStartAngle”] = “45”; Chart1.Series[0].LabelForeColor = Color.Black; Chart1.Legends[“Legend1”].Docking = Docking.Bottom; Chart1.Legends[“Legend1”].IsDockedInsideChartArea = false; Chart1.ChartAreas[“ChartArea1”].Area3DStyle.Enable3D = true; Chart1.ChartAreas[“ChartArea1”].Area3DStyle.Inclination = 30; Chart1.DataSource = ds; […]

ASP.Net MS图表控制饼图:删除不需要的填充

您好 我试图使用MS Chart控件创建简单的饼图。 当我的饼图在浏览器中呈现时,我得到饼图周围的填充,我无法摆脱。 我想饼图坐在图像的边缘没有填充或边距。 关于我如何实现这一点的任何想法? 在我的代码下面,填充以蓝色突出显示。 即Chart1.BackColor = System.Drawing.Color.Blue; protected void Page_Load(object sender, EventArgs e) { //Set the chart type Chart1.Series[“Series1”].ChartType = SeriesChartType.Pie; //add points Chart1.Series[“Series1”].Points.AddY(12); Chart1.Series[“Series1”].Points.AddY(45); Chart1.Series[“Series1”].Points.AddY(67); //set back color of chart object Chart1.BackColor = System.Drawing.Color.Blue; //set back color of chart area Chart1.ChartAreas[“ChartArea1”].BackColor = System.Drawing.Color.Green; }

在C#中制作图形饼图

我正在尝试编写一个Windows应用程序,显示一个包含七个不等切片(25%,20%,18%,17%,10%,10%,10%)的饼图,所有这些切片的颜色都不同。 到目前为止,我已经制作了带有颜色的钢笔和画笔并画了一个圆圈。 这就是我到目前为止所拥有的 private void Form1_Paint(object sender, PaintEventArgs e) { this.BackColor = Color.White; this.Text = “Pie Chart”; this.Width = 350; this.Height = 350; Pen black = new Pen(Color.Black); Pen blue = new Pen(Color.Blue); Pen green = new Pen(Color.Green); Pen red = new Pen(Color.Red); Pen orange = new Pen(Color.Orange); Pen pink = new Pen(Color.Pink); Pen purple […]

如何在饼图中设置图例中的不同标签

我正在做一个里面有Pie Chart的窗口表格。我需要显示饼图的百分比。 但现在我遇到了一个问题:当我将#PERCENT{P2}添加到系列时, Pie Chart将显示如下: 但如果我删除它, Pie Chart将显示如下 是否有可能像这样制作Pie Chart ? 我的代码: DataTable dt = new DataTable(); dt.Columns.Add(“completed”, typeof(string)); dt.Columns.Add(“no”, typeof(int)); int noin = allitem – intime; dt.Rows.Add(“Complete In Time”, intime); dt.Rows.Add(“OverDue”, noin); chart1.DataSource = dt; chart1.DataBind();