Pie Chart and List of Object Lists
Pie Chart and List of Object Lists
Hi,
I have a little problem of understanding with the Pie Chart. I'll try to describe my problem with an example :
1°) I have one product which contains several properties which have a particular value in a specific date
2°) My ProductValueDateList contains one product's values for several date
3°) My ProductList contains several ProductValueDateList , as many as product I have.
I want my Pie Chart display the value for each product in the same date (for compare them). How can I do this ?
If you do not understand what I mean, I can draw something much easier to understand (sometime, draw is a better language than write).
This is a little complex, that's why I require your help.
Thank you =)
I have a little problem of understanding with the Pie Chart. I'll try to describe my problem with an example :
1°) I have one product which contains several properties which have a particular value in a specific date
2°) My ProductValueDateList contains one product's values for several date
3°) My ProductList contains several ProductValueDateList , as many as product I have.
I want my Pie Chart display the value for each product in the same date (for compare them). How can I do this ?
If you do not understand what I mean, I can draw something much easier to understand (sometime, draw is a better language than write).
This is a little complex, that's why I require your help.
Thank you =)
Re: Pie Chart and List of Object Lists
Hello Alexandre,
I think that you can achieve following doing next:
1.- Select of your productList one ProductValueDateList.
2.- Add ProducteValueDateList to Pie, that you find value as you want doing a query to date.
3.- Add value are you find in Pie and you can use name of product as label.
I hope will help.
Thanks,
I think that you can achieve following doing next:
1.- Select of your productList one ProductValueDateList.
2.- Add ProducteValueDateList to Pie, that you find value as you want doing a query to date.
3.- Add value are you find in Pie and you can use name of product as label.
I hope will help.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Pie Chart and List of Object Lists
Hi Sandra,
Thank you for the answer.
I tried to follow your advices but nothing is displaying in the chart.
Here's the code I used :Is there a problem with it or am I misunderstanding you ?
I don't need the ProducteValueDateList in the chart, just the value (here's AUMPart) for one specific Date.
Thanks.
Thank you for the answer.
I tried to follow your advices but nothing is displaying in the chart.
Here's the code I used :
Code: Select all
foreach (List<AUM> item in aListOfAumLists)
{
pie.Add(from aum in item where aum.Date == aDate select aum.AUMPart);
}
I don't need the ProducteValueDateList in the chart, just the value (here's AUMPart) for one specific Date.
Thanks.
Re: Pie Chart and List of Object Lists
Hello Alexandre,
Ok. Can you send us, a simple project so we can reproduce exactly your problem and we can try to detected where is it occurs?
Thanks,
Ok. Can you send us, a simple project so we can reproduce exactly your problem and we can try to detected where is it occurs?
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Pie Chart and List of Object Lists
Hi Sandra,
Here's the simple project I created for you. It's a little simplistic but it's more or less what I've done in my real project.
Thank you.
Here's the simple project I created for you. It's a little simplistic but it's more or less what I've done in my real project.
Thank you.
- Attachments
-
- PieChart.zip
- (31.46 KiB) Downloaded 255 times
Re: Pie Chart and List of Object Lists
Hello Alexandre,
Seems that your problem is when you do the select. I have solved it changing next code:
To the below lines of code:
Please, do my recommendation changes in your application and tell us if these solve your problem.
I hope will helps.
Thanks,
Seems that your problem is when you do the select. I have solved it changing next code:
Code: Select all
foreach (List<Product> item in aListOfProductLists)
{
IEnumerable<double> result = from product in item where product.Date == aDate select product.Price;
pie.Add(from product in item where product.Date == aDate select product.Price);
}
Code: Select all
foreach (List<Product> item in aListOfProductLists)
{
IEnumerable<double> result = from product in item where product.Date == aDate select product.Price;
foreach (var item1 in result.ToList())
{
pie.Add(item1);
}
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Pie Chart and List of Object Lists
Hi Sandra,
Your recommendation was very helpful and solved my problem.
Thank you very much =)
Best regards.
Your recommendation was very helpful and solved my problem.
Thank you very much =)
Best regards.
Re: Pie Chart and List of Object Lists
Just one more little question.
How can I add the ID corresponding to my Product in the Chart Legend ?
Thank you.
How can I add the ID corresponding to my Product in the Chart Legend ?
Thank you.
Re: Pie Chart and List of Object Lists
Sorry for the triple post (no edit function ?), but I found the solution :
var result = from aum in aumList where aum.Date == aDate select new { aum.AUMPart, aum.CodeShare };
foreach (var item in result.ToList())
{
pie.Add(item.AUMPart, item.CodeShare);
}
Thanks =)
var result = from aum in aumList where aum.Date == aDate select new { aum.AUMPart, aum.CodeShare };
foreach (var item in result.ToList())
{
pie.Add(item.AUMPart, item.CodeShare);
}
Thanks =)
Re: Pie Chart and List of Object Lists
Hello Alexandre,
Don't worry. I am glad that you find a solution for your problem
Thanks,
Don't worry. I am glad that you find a solution for your problem
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |