zoukankan      html  css  js  c++  java
  • C# 显示图表数据实例

     1 using System;
     2 using System.Collections.Generic;
     3 using System.ComponentModel;
     4 using System.Data;
     5 using System.Drawing;
     6 using System.Linq;
     7 using System.Text;
     8 using System.Windows.Forms;
     9 using System.Windows.Forms.DataVisualization.Charting;
    10 
    11 namespace WindowsFormsApplication8
    12 {
    13     public partial class Form1 : Form
    14     {
    15         public Form1()
    16         {
    17             InitializeComponent();
    18         }
    19 
    20         private void Form1_Load(object sender, EventArgs e)
    21         {
    22             //清除默认的series
    23             chart1.Series.Clear();
    24             //new 一个叫做【Strength】的系列
    25             Series Strength = new Series("力量");
    26             Series test = new Series("耐力");
    27             test.ChartType = SeriesChartType.Radar;
    28             //设置chart的类型,这里为柱状图
    29             Strength.ChartType = SeriesChartType.Radar;
    30             //给系列上的点进行赋值,分别对应横坐标和纵坐标的值
    31             Strength.Points.AddXY("A", "90");
    32             Strength.Points.AddXY("B", "88");
    33             Strength.Points.AddXY("C", "60");
    34             Strength.Points.AddXY("D", "93");
    35             Strength.Points.AddXY("E", "79");
    36             Strength.Points.AddXY("F", "85");
    37             test.Points.AddXY("A", "20");
    38             test.Points.AddXY("B", "20");
    39             test.Points.AddXY("C", "50");
    40             test.Points.AddXY("D", "99");
    41             test.Points.AddXY("E", "50");
    42             test.Points.AddXY("F", "89");
    43 
    44             chart1.Series.Add(Strength);
    45             chart1.Series.Add(test);
    46 
    47         }
    48     }
    49 }
  • 相关阅读:
    验证手机和电话号码
    oracle取字符串长度的函数length()和hengthb()
    AngularJs教程
    nop commerce文档
    根据子查询批量删除的sql语句
    AngularJs赋值问题
    PetaPoco模糊查询
    js转换 /Date(1464671903000)/ 格式的日期的方法
    jquery-cookie插件怎么读写json数据
    executssql 函数的每一句代码的意思
  • 原文地址:https://www.cnblogs.com/heroysj/p/10881832.html
Copyright © 2011-2022 走看看