Unfortunately I m new to Lambda/ Linq and I need to get data from a list. Below is my existing code:
Highcharts chart = new Highcharts("chart")
.InitChart(new Chart { DefaultSeriesType = ChartTypes.Bubble, ZoomType = ZoomTypes.Xy, Width = 600, Height = 400 })
.SetTitle(new Title { Text = "Highcharts Bubbles" })
.SetSeries(new[]
{
new Series
{
Name="Buy",
Data = new Data(new object[]
{
new object[] {97,36,79 },
new object[] { 94,74,60 },
new object[] { 68,76,58 }
})
}
});
Lines of code which need to be replaced are:
new object[] {97,36,79 },
new object[] { 94,74,60 },
new object[] { 68,76,58 }
In above code inside {} instead of hardcoded values for example 97, 36, 79 in first line I need to pass values from transactions (transaction volume, price and termdate).
(it is just like using foreach loop but I have to do it using Lambda/ Linq.) I can query all transactions in list transaction.
My poco class is:
public class Transaction : SearchCondition, Automappable
{
[ScriptIgnore]
public virtual int Id { get; set; }
public virtual decimal Volume { get; set; }
public virtual decimal Price { get; set; }
public virtual DateTime TermDate { get; set; }
}
Can you please help me modifying code.
I highly appreciate your time, guidance and help.
EDIT I have tried the ways mentioned in below solutions, it is almost what is required but still a small issue.
Below codes are able to supply data but they cover data with an additional array. To clear it more please see below image of incorrect structure
:
It do not show an error but because of that I am not able to use data.
Below is a snap short of correct data structure.

Can you please help a little more.