0

I have a problem displaying data on a ShieldUI JavaScript Chart. The values I want to show are entered by the user in some text fields. I made sure that the function is actually being called. Here is my code:

 var Participants = new Array();
    Participants [0]=document.getElementById("ParticipantA").value;
    Participants [1]=document.getElementById("ParticipantB").value;
    Participants [2]=document.getElementById("ParticipantC").value;

and that I do put the data on the chart:
dataSeries: [
                {
                    seriesType: 'line',
                    collectionAlias: 'chart',
                    data: [Participants [0], Participants [1], Participants [2]]
                }
3
Contributors
2
Replies
6
Views
1 Year
Discussion Span
Last Post by baker-thomas
0

The one error I can see, is that the values of the text fields are not in the correct format. Although you might be entering numerical values, you need to convert them explicitly, in order to be used with your Shield UI Chart:

var Participants = new Array();
Participants [0]=parseFloat(document.getElementById("ParticipantA").value);
Participants [1]=parseFloat(document.getElementById("ParticipantB").value);
Participants [2]=parseFloat(document.getElementById("ParticipantC").value);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.