Welcome to the Xceed Community | Help
Community Search  

Database and Populate X-Axis from database.

Sort Posts: Previous Next
  •  09-03-2008, 2:35 AM Post no. 14817

    Database and Populate X-Axis from database.

    Hi. I am still new to Xceed chart for ASP.Net.

    I can connect to the Database and fetch out the columns from a table and display them to my chart(xceed).

    However, I can not specify my X-Axis to populate from the database.

    For example, i want to plot a graph of Sales Vs Date.

    On my Y-Axix, i can show the sales figure but can't show the Date(stored in the database).

    Please can someone help me with the code to populate my X-axis from the database???

    Thanks.

  •  10-29-2008, 12:09 PM Post no. 16492 in reply to 14817

    Re: Database and Populate X-Axis from database.

    You need to set the X-axis to a DateTimeScale, and set the series to use XValues.

    e.g.:

    chart.Axis( StandardAxis.PrimaryX ).ScaleMode = AxisScaleMode.DateTime;

    chart.Axis( StandardAxis.PrimaryX ).ValueFormatting.Format = ValueFormat.Date;

    lineSeries.UseXValues = true;

    line.AddXY( 40, new DateTime( 2008, 1, 1, 5, 30, 20 ).ToOADate() );

     


    André
    Software Developer and Tech Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.