Dylan Gomes
Dylan Gomes

Reputation: 93

Data chart doesn't add all data

The data chart is made cearly everythings work but it just doesn't add dp3 4 and 5 while i debug they are filled with a integer but they dont add in the datachart as a new line

 case "leeftijd":
                    getal = await Database.GetResultaten(leeftijd, geslacht, regio);
                    getal1 = await Database.GetVragenlijst(leeftijd, geslacht, regio, 1);
                    getal2 = await Database.GetVragenlijst(leeftijd, geslacht, regio, 2);
                    getal3 = await Database.GetVragenlijst(leeftijd, geslacht, regio, 3);
                    getal4 = await Database.GetVragenlijst(leeftijd, geslacht, regio, 4);
                    getal5 = await Database.GetVragenlijst(leeftijd, geslacht, regio, 5);
                    Makedp();
                    //toon enkel gegevens per leeftijd via een methode
                    break;
            }

        }
        public void Makedp()
        {
            theSerie.Points.Clear();
            DataPoint dp = new DataPoint();
            dp.XValue = 0;
            dp.SetValueY(getal);

            DataPoint dp1 = new DataPoint();
            dp1.XValue = 0;
            dp1.SetValueY(getal1);

            DataPoint dp2 = new DataPoint();
            dp2.XValue = 0;
            dp2.SetValueY(getal2);

            DataPoint dp3 = new DataPoint();
            dp2.XValue = 0;
            dp2.SetValueY(getal3);

            DataPoint dp4 = new DataPoint();
            dp2.XValue = 0;
            dp2.SetValueY(getal4);

            DataPoint dp5 = new DataPoint();
            dp2.XValue = 0;
            dp2.SetValueY(getal5);

            theSerie.Points.Add(dp);
            theSerie.Points.Add(dp1);
            theSerie.Points.Add(dp2);
            theSerie.Points.Add(dp3);
            theSerie.Points.Add(dp4);
            theSerie.Points.Add(dp5);
        }

The problem is when i debug it fills getal3, getal4 and getal5 with data but it doesn't show in the datachart how is this? I can see dp dp1 and dp2 on chart but not dp3 dp4 and dp5

Upvotes: 0

Views: 59

Answers (1)

Dylan Gomes
Dylan Gomes

Reputation: 93

public void Makedp()
        {
            theSerie.Points.Clear();
            theSerie.Points.AddY(getal);
            theSerie.Points.AddY(getal1);
            theSerie.Points.AddY(getal2);
            theSerie.Points.AddY(getal3);
            theSerie.Points.AddY(getal4);
            theSerie.Points.AddY(getal5);

    }

this works perfectly now

Upvotes: 0

Related Questions