Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8669791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:33:39+00:00 2026-06-12T18:33:39+00:00

I want to present some condensed data to the user using the Chart component.

  • 0

I want to present some condensed data to the user using the Chart component.

SQL (C# / Oracle):

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

I have this SQL in a method that passes a DataSet to the ObjectDataSource in the .aspx page (The approved field can have 3 values: REJECTED, APPROVED and PENDING).

Chart in .aspx page:

<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=Zero, DrawSideBySide=True" 
            YValuesPerPoint="4">
        </asp:Series>
        <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">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>

I want to show the numbers of approved/pending contracts/bens for each day (4 bars), but the chart shows only two columns.
Column chart

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:33:41+00:00Added an answer on June 12, 2026 at 6:33 pm

    Solved by creating an object relatorio to hold the returned data (instead of the DataSet), filtering the results using LINQ to Objects, and adding the series programmatically in codeBehind.

    var approved = relatorio
        .Where(r => r.APPROVED == "APPROVED")
        .ToList()
        ;
    var pending = relatorio
        .Where(r => r.APPROVED == "PENDING")
        .ToList()
        ;
    

    Creating Legends

    Legend legenda = new Legend("Legenda");
    legenda.Docking = Docking.Bottom;
    legenda.LegendStyle = LegendStyle.Row;
    legenda.Alignment = System.Drawing.StringAlignment.Center;
    

    Creating series in a loop

    for (int i = 0; i < 4; i++) {
        Series temp = new Series {
            XAxisType = AxisType.Primary,
            XValueType = ChartValueType.DateTime,
            YAxisType = AxisType.Primary,
            //mostra só a quantidade de contratos
            IsValueShownAsLabel = i % 2 == 0 ? true : false,
            ChartType = SeriesChartType.Column,
            CustomProperties = "EmptyPointValue=Zero",
            Legend = "Legenda"
        };
        grafico.Series.Add(temp);
    }
    approvedValues.Points.DataBindXY(approved, "DATE", approved, "SUM_VALUES");
    

    DataBinding series

    // approved CONTRACTS
    grafico.Series[0].Points.DataBindXY(approved, "DATE", approved, "AMT_C");
    grafico.Series[0].LegendText = "Contratos approved";
    // approved BENS
    grafico.Series[1].Points.DataBindXY(approved, "DATE", approved, "AMT_B");
    grafico.Series[1].LegendText = "Ben approved";
    grafico.Series[1].ChartType = SeriesChartType.Line;
    // pending CONTRACTS
    grafico.Series[2].Points.DataBindXY(pending, "DATE", pending, "AMT_C");
    grafico.Series[2].LegendText = "Contratos pending";
    // pending BENS
    grafico.Series[3].Points.DataBindXY(pending, "DATE", pending, "AMT_B");
    grafico.Series[3].LegendText = "Ben pending";
    grafico.Series[3].ChartType = SeriesChartType.Line;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to present some text in the GUI and give the user that
I have some data that I want to present in a FlowDocument . This
I'm using the Infragistics UltraWinGrid to present some data. I need some Excel copy/paste
Background: I have some data that I want to present in a table. Each
I create some KML files in my project and I want to present on
In my application I want to present a list of choices for a user
I have a dilema, I want to present to the user a semi-transparent view.
I want to present some choices in my application. Right now I'm doing it
For a questionnaire, I want to present a sequence of forms to the user.
I have been using a scope to present some information to show todos that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.