public static Chart Doughnut() { var doughnut = new Doughnut { Points = { {"France", 65.62} , {"Canada", 75.54} , { "UK", new Doughnut.DataPoint(60.45) { Exploded = true , LegendText = "God save the queen!" } } , {"USA", 55.73} , {"Italy", 70.42} } , DoughnutRadius = 60 , DrawingStyle = PieDrawingStyle.SoftEdge , LabelStyle = LabelStyle.Inside }; var doughnutchart = new Chart { doughnut }; doughnutchart.Dock = DockStyle.Fill; return doughnutchart; }
public static Chart Pie() { var pie = new Pie { Points = { { "System", 20 } , { "Linq", new Pie.DataPoint(40){ ToolTip = "LINQ to Charts!", } } , { "Charting", new Pie.DataPoint(10){ Color = Color.HotPink }} } , DrawingStyle = PieDrawingStyle.Concave , StartAngle = 45 }; var piechart = new Chart { pie }; piechart.Dock = DockStyle.Fill; return piechart; }
private void InitChart() { var area = new ChartArea(); area.AxisX.Title = "Time"; area.AxisX.TitleFont = new Font(area.AxisX.TitleFont, FontStyle.Bold); area.AxisX.ArrowStyle = System.Windows.Forms.DataVisualization.Charting.AxisArrowStyle.Triangle; area.AxisY.Title = "Value"; area.AxisY.TitleFont = new Font(area.AxisY.TitleFont, FontStyle.Bold); area.AxisY.ArrowStyle = System.Windows.Forms.DataVisualization.Charting.AxisArrowStyle.Triangle; _chart = new Chart { ChartAreas = { area }, Dock = DockStyle.Fill, }; }
public TcpSyntheticCounters() { InitializeComponent(); ChartArea area = new ChartArea(); area.AxisX.Title = "Minutes since start"; area.AxisX.TitleFont = new System.Drawing.Font(area.AxisX.TitleFont, FontStyle.Bold); area.AxisX.ArrowStyle = System.Windows.Forms.DataVisualization.Charting.AxisArrowStyle.Triangle; area.AxisY.Title = "Bytes per second"; area.AxisY.TitleFont = new System.Drawing.Font(area.AxisY.TitleFont, FontStyle.Bold); area.AxisY.ArrowStyle = System.Windows.Forms.DataVisualization.Charting.AxisArrowStyle.Triangle; _received = new Column { Points = { }, LegendText = "Received" }; _send = new Column { Points = { }, LegendText = "Send" }; _chart = new Chart { ChartAreas = { area }, Dock = DockStyle.Fill, }; this.Controls.Add(_chart); }
public static Chart Fast() { var ys1 = EnumerableEx.Defer(delegate { var random = new Random(0); return EnumerableEx.Generate(50.0, y => true, y => y + (random.NextDouble() * 10.0 - 5.0), y => y); }); var ys2 = EnumerableEx.Defer(delegate { var random = new Random(1); return EnumerableEx.Generate(200.0, y => true, y => y + (random.NextDouble() * 10.0 - 5.0), y => y); }); var beans = new FastLine() { Points = { from y in ys1.Take(1000000) select y } , LegendText = "Garbonzo Beans" }; var brocolli = new FastLine() { Points = { from y in ys2.Take(1000000) select y } , LegendText = "Brocolli" }; var chart = new Chart { ChartAreas = { new ChartArea { beans, brocolli } }, BackColor = System.Drawing.Color.WhiteSmoke, BackGradientStyle = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom, BackSecondaryColor = System.Drawing.Color.White, BorderlineColor = System.Drawing.Color.FromArgb(26, 59, 105), BorderlineDashStyle = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid, BorderlineWidth = 2, BorderSkin = { SkinStyle = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss }, Dock = DockStyle.Fill }; return chart; }
public static Chart Lines3D() { var series1 = new Spline(); var series2 = new Spline(); var series3 = new Spline(); // imperative var random = new Random(); for (var pointIndex = 0; pointIndex < 10; pointIndex++) { series1.Add(random.Next(45, 95)); series2.Add(random.Next(5, 75)); series3.Add(random.Next(2, 50)); } var area = new System.Linq.Charting.ChartArea { Area3DStyle = { Enable3D = true , Inclination = 38 , Rotation = 9 , Perspective = 10 , PointDepth = 200 , LightStyle = System.Windows.Forms.DataVisualization.Charting.LightStyle.Realistic , IsRightAngleAxes = false , WallWidth = 0 } , AxisX = { IsMarginVisible = true } , Series = { series1, series2, series3 } }; var chart = new System.Linq.Charting.Chart { ChartAreas = { area } , Titles = { new System.Windows.Forms.DataVisualization.Charting.Title{ Text = "Three 3D Lines" , Font = new Font(FontFamily.GenericSansSerif, 20) } } , Dock = DockStyle.Fill }; return chart; }