Announcement

Collapse
No announcement yet.

Diagrammtyp Chart control mit C# erstellen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Diagrammtyp Chart control mit C# erstellen

    Hallo,
    Ich muss einen Diagrammtyp Chart Control mit C # und unserer Datenbank erstellen.
    Ich habe das Projekt angefangen.
    Ich gebe die Datenquelle mit folgende code.
    Code:
      public partial class Chart_Ansicht_Infos : Form
        {
            public Chart_Ansicht_Infos()
            {
                InitializeComponent();
            }
    
            BibliothequeEntities db = new BibliothequeEntities();
    
            private void Chart_Ansicht_Infos_Load(object sender, EventArgs e)
            {
                // TODO: This line of code loads data into the 'barForceDataSet1.SlitteApp' table. You can move, or remove it, as needed.
                this.slitteAppTableAdapter1.Fill(this.barForceDataSet1.SlitteApp);
                chart1.Series[0].XValueMember = "Jahre";
                chart1.Series[0].YValueMembers = "Date";
                slitteAppBindingSource.DataSource = barForceDataSet.SlitteApp.FirstDownloadBtnWPDateColumn;
                // TODO: This line of code loads data into the 'barForceDataSet.SlitteApp' table. You can move, or remove it, as needed.
                this.slitteAppTableAdapter.Fill(this.barForceDataSet.SlitteApp);
    
            }
    Aber beim Kompielieren wird nichts gezeigt und ich bekommen folgende meldung bei meiner Main() function.
    Code:
    
     unhandled exception of type 'System.ArgumentException' occurred in System.Windows.Forms.DataVisualization.dll
     
    Additional information: Series data points do not support values of type System.Data.DataColumn only values of these types can be used: Double, Decimal, Single, int, long, uint, ulong, String, DateTime, short, ushort.

    Woran kann das liegen?
    Danke im Vorraus

  • #2
    Hallo Leute,
    mit folgende SQL_Code greife ich auf meine Daten, die ich brauche zu.
    USE BarForce SELECT CONVERT(date, FirstInProductionDate), COUNT(CONVERT(date, FirstInProductionDate)) FROM SlitteApp WHERE FirstInProductionDate IS NOT NULL GROUP BY CONVERT(date, FirstInProductionDate) ORDER BY CONVERT(date, FirstInProductionDate)
    Bitte wie kann ich diese code in meiner C# code programmieren, damit die Daten in meinem Chart Graphics dargestellt wird.
    Danke im vorraus

    Comment


    • #3
      Hallo Leute,
      Bitte Bitte Ich möchte gern Ein programmcode, welche mir diese Tabelle von meinem Sql-server liest und in meinem Chart-Diagramm darstellt. Die Verbindung zu Server ist schon OK. und die chart Graphic habe ich schon erstellt. Nun muss ich nur anhang eine code die Tabelle lesen und im Diagramm erstellen. X-axe ist die Datum und Y-axe ist die Produktionanzahl.

      Datum Produktionsanzahl
      2013-09-18 27
      2013-09-19 12
      2013-09-20 91
      2013-09-21 50
      2013-09-22 34
      2013-09-23 46
      2013-09-24 76
      2013-09-25 28
      2013-09-26 133

      Bitte helfen Sie mir. Bitte bitte

      Comment


      • #4
        Danke im vorraus

        Comment


        • #5
          Es kennt sich wohl eher niemand hier mit dem Chart Control aus.
          Vielleicht helfen dir ja einfach die Standardbeispiele zum Chart um rauszufinden was du falsch machst.

          Comment

          Working...
          X