How to show asp.net chart grouped by 2 parameters

adikryan03

New Member
I want to present some condensed data to the user using the \[code\]Chart\[/code\] component.SQL (C# / Oracle):\[code\]SELECT c.date, c.approved, count(distinct c.f1) amt_c, count(b.f1) amt_b, sum(b.value)FROM contracts cJOIN bens b ON c.ben_id = b.idWHERE :YearMonth = to_char(c.date,'YYYYMM') AND NOT c.approved = 'REJECTED'GROUP BY c.date, c.approvedORDER BY c.date\[/code\]I have this SQL in a method that passes a DataSet to the ObjectDataSource in the .aspx page (The \[code\]approved\[/code\] field can have 3 values: REJECTED, APPROVED and PENDING).Chart in .aspx page:\[code\]<asp:Chart ID="Chart1" runat="server" DataSourceID="RelatorioDataSource" Width="700px" Compression="10" Palette="Chocolate"> <Series> <asp:Series Name="Contracts" XValueMember="date" YValueMembers="amt_c" IsXValueIndexed="False" XValueType="DateTime" IsValueShownAsLabel="True" BorderDashStyle="DashDot" CustomProperties="DrawingStyle=Emboss, EmptyPointValue=http://stackoverflow.com/questions/12808642/Zero, DrawSideBySide=True" YValuesPerPoint="4"> </asp:Series> <asp:Series BorderDashStyle="DashDot" ChartArea="ChartArea1" CustomProperties="DrawingStyle=Emboss, EmptyPointValue=http://stackoverflow.com/questions/12808642/Zero, DrawSideBySide=True" IsValueShownAsLabel="True" Name="Bens" XValueMember="date" XValueType="DateTime" YValueMembers="amt_b" YValuesPerPoint="4"> </asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="ChartArea1"> </asp:ChartArea> </ChartAreas></asp:Chart>\[/code\]I want to show the numbers of approved/pending contracts/bens for each day (4 bars), but the chart shows only two columns.
NLOuh.png
 
Back
Top