图表控件Vb.Net和C# [英] Chart Control Vb.Net And C#

查看:94
本文介绍了图表控件Vb.Net和C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb.net或c#中使用图表控件?
而且,如果我精通Visual Basic编程,是否表示我知道C夏普编程?

How to use the chart control in vb.net or c#?
And If I Know well Visual Basic Programming, does it mean that i know and C Sharp programming?

推荐答案

using System;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        // Data arrays.
        string[] seriesArray = { "Cats", "Dogs" };
        int[] pointsArray = { 1, 2 };

        // Set palette.
        this.chart1.Palette = ChartColorPalette.SeaGreen;

        // Set title.
        this.chart1.Titles.Add("Pets");

        // Add series.
        for (int i = 0; i < seriesArray.Length; i++)
        {
        // Add series.
        Series series = this.chart1.Series.Add(seriesArray[i]);

        // Add point.
        series.Points.Add(pointsArray[i]);
        }
    }
    }
}


查看此处:
^ ]
^ ]

示例 [
See here:
Chart control example in C#[^]
Chart control in c# tutorial[^]

Chart control in vb.net[^] & example[^] on same.


这篇关于图表控件Vb.Net和C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆