zoukankan      html  css  js  c++  java
  • winform 图标表chart

    先链接数据库新建一个LinQ

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace WindowsFormsApplication16
    {
        public partial class Form1 : Form
        {
            private DataClasses1DataContext Context;
            public Form1()
            {
                InitializeComponent();
                Context = new DataClasses1DataContext();
    
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                List<Car> list = Context.Car.Take(5).ToList();
                //为图表指定数据源
                chart1.DataSource = list;
                chart1.Series["Series1"].XValueMember = "Name";
                chart1.Series["Series1"].YValueMembers = "Oil";
                chart1.Series["Series2"].XValueMember = "Name";
                chart1.Series["Series2"].YValueMembers = "powers";
                chart1.Series["Series2"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.FastLine;
            }
        }
    }
  • 相关阅读:
    守护线程
    接口中的方法重写
    jvm内存结构
    浅拷贝,深拷贝
    队列
    12月4号荒度了一天
    同步条件
    条件变量
    信号量Semaphore
    sql练习
  • 原文地址:https://www.cnblogs.com/dlexia/p/4649042.html
Copyright © 2011-2022 走看看