Click here to Skip to main content
16,012,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,

I am new to linq coding and i have to do a bar graph in visifire using linq as coding language.
My question is i have to show the graph of commission for policies of this month..means MTD... current months week should be shown on the X-axis..

Do anybody have any idea how to do this..
i Have done this for year and month.. but unable to do for week of a month..
Pls help ..
Posted

1 solution

i can provide u linq query. but i don't know visfire.
i have implemented bar graph using fusion charts.

sample code of linq (this linq query gets daily sales details of company)

C#
public string CreateChart()
    {
        string strXML;
        strXML = "<graph caption='Billing Report' subCaption='By Date' decimalPrecision='2' showNames='1' pieSliceDepth='30' formatNumberScale='0'>";
        var query = from i in db.InvoiceHeaders where i.BillTypeId == 1 group i by i.InvoiceDate into g select new { Date = g.Key.Value.Date, Total = g.Sum(o => o.BasicTotal) };
        foreach (var p in query)
        {
            strXML += "<set name='" + String.Format("{0:dd/MM}", p.Date) + "' value='" + p.Total + "' />";
        }
        strXML += "</graph>";
        return FusionCharts.RenderChart("Charts/FCF_Line.swf", "", strXML, "FactorySum", "650", "300", false, false);
    }


Note: it is using fusion charts(open source) if need link for fusion chart i can provide or u can google it as fusion chart for asp.net application sample.
 
Share this answer
 
Comments
Saumya J Pandey 9-May-11 1:05am    
thanks satyanarayanana, i`ll check this.May be it works for me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900