Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace PeneAdvancedDibujado
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- //populate dataset with some demo data..
- List<Cosa> hola = new List<Cosa>();
- hola.Add(new Cosa("Berquelin", 3));
- hola.Add(new Cosa("GionPorr", 4));
- hola.Add(new Cosa("Yo", 23));
- chart1.Series["Series1"].Points.Clear();
- chart1.Series["Series1"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
- foreach (Cosa tagname in hola)
- {
- chart1.Series["Series1"].Points.AddXY(tagname.nombre, tagname.dato);
- }
- }
- }
- public class Cosa {
- public string nombre {get; set;}
- public int dato {get; set;}
- public Cosa(string nombre, int dato) {
- this.nombre = nombre;
- this.dato = dato;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement