Autor Beitrag
Ivy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Mo 14.03.11 16:47 
Hallo zusammen,
wie kann ich mein MS Chart mit hilfe eines von mir erstellten DataSets füllen?
das ist mein erstelltes DataSet
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
DataSet ShiftStat = new DataSet();
        DataTable shiftTable = ShiftStat.Tables.Add();

        //DummyRows
        shiftTable.Columns.Add("Typecode"typeof(string));
        shiftTable.Columns.Add("Typinfo"typeof(string));
        shiftTable.Columns.Add("Passresult"typeof(int));
        shiftTable.Columns.Add("Failresult"typeof(int));
        shiftTable.Columns.Add("Noresult"typeof(int));

        //DummyData
        shiftTable.Rows.Add("Test1""abc"2,3,0);
        shiftTable.Rows.Add("Test2""dfhdh"5,3,4);
        shiftTable.Rows.Add("Test3""hgfhhgr"6,3,4);
        shiftTable.Rows.Add("Test4""gfhh"5,5,0);
        shiftTable.Rows.Add("Test5""hggf"5,2,1);

        //Show Data in Datagridview
        foreach (DataTable table in ShiftStat.Tables)
        {
            foreach (DataRow row in table.Rows)
            {
                dgvData.DataSource = table;
            }
        }


lg
ivy


Zuletzt bearbeitet von Ivy am Di 22.03.11 10:32, insgesamt 2-mal bearbeitet
mark77
Hält's aus hier
Beiträge: 7



BeitragVerfasst: Mo 14.03.11 17:57 
Hi ivy,

hast Du mal zedgraph probiert? Damit habe ich mal ein paar Diagramme in VB erstellt.
Die dll war einfach zu verwenden und Beispielcode gibt es auch reichlich.

zedgraph.sourceforge.net/samples.html

Gruß,
Mark
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Di 15.03.11 09:06 
funktioniert es nicht auch mit dem Microsoft Chart Tool?
weil ich soll es damit machen...
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Di 22.03.11 10:31 
weiß niemand etwas über chart und wie man diese mit einem dataset füllt???
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 22.03.11 11:03 
Suche bei Google MICROSOFT CHART TOOL MIT DATEN FÜLLEN
Ich habe mir die Suchergebnisse nicht im Einzelnen angesehen, aber mir scheint, dass da doch ein paar passende Treffer bei sind.
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Di 22.03.11 11:29 
okay super, das bringt mich schonmal weiter.
aber wie kommen jetzt die daten aus meinem dataset ins chart. jetzt hab ichs nur mit von mir eingebenen koordinaten geschafft was in das chgart hineinzubekommen
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
  chart1.Series[0].Name = "Test";
        chart1.DataSource = shiftTable;
        chart1.DataBind();
       chart1.Series[0].Points.AddXY(2,9);
       chart1.Series[0].Points.AddXY(56);