I am using flot charts and I am having trouble setting the data from my database source. I have a query which comes out with the below:
ReadDate Actual Average
2011-01-12 107132.150 45311.823
2011-01-13 90576.574 46980.152
2011-01-14 89244.989 47226.490
I want to plot this data on a flot graph where the x-axis is the read date, actual is series one and average is series 2. At the moment I am trying to create the expected object as below from this C# List(). The expected structure of the data flot expects is:
var data = [{
// actual
data: [[1, 30], [2, 40]],
color: '#8bc12c',
points: { radius: 4, fillColor: '#8bc12c' }
},
// average
data: [[1, 30], [2, 40]],
color: '#8bc12c',
points: { radius: 4, fillColor: '#8bc12c' }
},
You will see this part called data: [[1, 30], [2, 40]]
is where I am struggling, here is my C# code:
Decimal[][,] arrays = {
new Decimal[,] {
{1, 30},
{2, 40}
},
new Decimal[,] {
{1, 30},
{2, 40}
}
};
Please see the variances below:
I have to build this object dynamically from the data source. Any help or guidance would be appreciated on this also. Thanks in advance