dotnetcharting 属性

来源:互联网 发布:东华软件 现金流 编辑:程序博客网 时间:2024/04/28 02:39

      Chart.DefaultElement.SmartLabel.Text = "%YValue"; //图表数据显示样式
      Chart.PieLabelMode = PieLabelMode.Outside;     //图表数据显示在(饼)图外(内)

      Chart.YAxis.Percent = true;//图表以百分比显示

      Chart.LegendBox.Position = LegendBoxPosition.Top;//提示说明框的位置

      Chart.TitleBox.Position = TitleBoxPosition.FullWithLegend;//标题框的位置

      Chart.Type = ChartType.Pie;//图表类型:饼图

      Chart.TitleBox.CornerTopLeft = BoxCorner.Square;//标题框四角的样式

      Chart.Background.Color = Color.FromArgb(0xe1, 0xe1, 0xe1); //图表的背景颜色,(不包含图表内部)

      Chart.ChartArea.Background = new Background("../../Images/background.gif",BackgroundMode.ImageStretch);

      Chart.BackColor = Color.FromArgb(0xe1, 0xe1, 0xe1);//整个图表的背景颜色(外延伸部分)

      Chart.YAxis.AlternateGridBackground.Color = Color.White;//交替网络颜色

        /* 添加背景(有范围的)*/

                    // AxisMarker am1 = new AxisMarker("Danger", new Background(Color.Red, Color.Red, 90), 85, 100);         
                    //AxisMarker am3 = new AxisMarker("Warning", new Background(Color.Orange, Color.Orange, 90), 50, 70);    
                    //AxisMarker am5 = new AxisMarker("Safe", new Background(Color.Yellow, Color.Yellow, 90), 0, 30);
                    // AxisMarker am2 = new AxisMarker("", new Background(Color.Red, Color.Orange, 90), 70, 85);
                    // AxisMarker am4 = new AxisMarker("", new Background(Color.Orange, Color.Yellow, 90), 30, 50);
                    // am1.LegendEntry.Visible = false;
                    // am2.LegendEntry.Visible = false;
                    // am3.LegendEntry.Visible = false;
                    // am4.LegendEntry.Visible = false;
                    // am5.LegendEntry.Visible = false;
                    //Chart.YAxis.Markers.Add(am1, am2, am3, am4, am5);

原创粉丝点击