Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to show asp.net chart grouped by 2 parameters
    primarykey
    data
    text
    <p>I want to present some condensed data to the user using the <code>Chart</code> component.</p> <p>SQL (C# / Oracle):</p> <pre><code>SELECT c.date, c.approved, count(distinct c.f1) amt_c, count(b.f1) amt_b, sum(b.value) sum_values FROM contracts c JOIN bens b ON c.ben_id = b.id WHERE :YearMonth = to_char(c.date,'YYYYMM') AND NOT c.approved = 'REJECTED' GROUP BY c.date, c.approved ORDER BY c.date </code></pre> <p>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).</p> <p>Chart in .aspx page:</p> <pre><code>&lt;asp:Chart ID="Chart1" runat="server" DataSourceID="RelatorioDataSource" Width="700px" Compression="10" Palette="Chocolate"&gt; &lt;Series&gt; &lt;asp:Series Name="Contracts" XValueMember="date" YValueMembers="amt_c" IsXValueIndexed="False" XValueType="DateTime" IsValueShownAsLabel="True" BorderDashStyle="DashDot" CustomProperties="DrawingStyle=Emboss, EmptyPointValue=Zero, DrawSideBySide=True" YValuesPerPoint="4"&gt; &lt;/asp:Series&gt; &lt;asp:Series BorderDashStyle="DashDot" ChartArea="ChartArea1" CustomProperties="DrawingStyle=Emboss, EmptyPointValue=Zero, DrawSideBySide=True" IsValueShownAsLabel="True" Name="Bens" XValueMember="date" XValueType="DateTime" YValueMembers="amt_b" YValuesPerPoint="4"&gt; &lt;/asp:Series&gt; &lt;/Series&gt; &lt;ChartAreas&gt; &lt;asp:ChartArea Name="ChartArea1"&gt; &lt;/asp:ChartArea&gt; &lt;/ChartAreas&gt; &lt;/asp:Chart&gt; </code></pre> <p>I want to show the numbers of approved/pending contracts/bens for each day (4 bars), but the chart shows only two columns. <img src="https://i.stack.imgur.com/NLOuh.png" alt="Column chart"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload