locked
date value in x axis not show properly RRS feed

  • Question

  • i'm using the dotnet bar chart control .the values are getting from db .

     

    sample data:

    id    rovalue    date

    1     30         12/07/2010

    2     40         16/07/2010

    3     60         20/07/2010

     

    xaxis value : date

    yaxis value :rovalue

     

    it works when i getting and binded in chart control as per the sample data here i metioned

     

    but my problem is xaxis showed all the values b/w 12/07/20/07-20/07/2010

    i dont want the format like this i have to show the 3 above dates in xaxis value 

     i set the interval mode=1 then the unwanted x axis value are gone.but the gaps showed between two date interval .i need the continuous bar chart for the date value with out any gap in chart 

     


    Sudhesh. G
    http://gurucoders.blogspot.com
    Tuesday, February 15, 2011 11:36 AM

All replies

  • I got the same problems. Hix.
    Monday, February 28, 2011 1:55 AM
  • Before adding the series to the chart, try setting the IsXValueIndesxed to true.

    newSeries.IsXValueIndexed = true;
    

     

     


    XML is like violence. If it doesn't solve your problem, you're not using enough of it
    Thursday, July 7, 2011 5:01 PM
  • It works if you have only one Series. I have 3 series.

     

    Sales,salesdatadetails, Goal and the Trend, how can you acchievie it

    Thursday, July 7, 2011 8:08 PM
  • 1) Try to have a common xaxis for all the three series. Common means same number and same values.

    2) Mark each series as isxvalueindexed = true.

    3) Plot Individual series on to the chart.

     

    I think this could be achieved by tweaking the series to achieve the above condition. tweaking essentially means using one or more of the aligning techniques. 

     

    If nothing works then use strings instead of date time values on the xaxis then align on xaxis lable. Chart1.AlignDataPointsByAxisLabel();   

     

    If you need more help then please post sample data 


    XML is like violence. If it doesn't solve your problem, you're not using enough of it
    Friday, July 8, 2011 12:43 PM
  • Date            Sales    Goal    SalesDetails
    6/26/2011    3334    5000    0
    6/27/2011    5674    5000    1
    6/28/2011    4593    5000    0
    6/29/2011    6439    5000    1
    6/30/2011    9433    5000    1
    6/31/2011    4752    5000    0

     

    X-Axis - Date

    Y-Axis - Sales

     

    series1 - Sales

    series2 - Goal

    Series3 - Sales Details ( plotted as data points with URLS, when the user clicks it displays a pop up with Sales Details/Notes)

    Saturday, July 9, 2011 1:29 PM
  • The sample data provided has a continuous time series 06/26/2011 to 06/31/2011, but the discussion on this thread is about discontinuous time series !! 

     

    If this is what you want to do then follow these steps

     

    1) build a List<DateTime> with all the x axis values

    2) build List<Double> of sales values, List<Double> Goal Values, List <int> Sales Details.

    3) bind the three series individually to the chart. 

    eg: 

     newSeries.Points.DataBindXY(xval, SalesVal);
     newSeries1.Points.DataBindXY(xval, GoalVal);
     newSeries2.Points.DataBindXY(xval, SalesDetailsVal);

    4) Now add those series to the chart.

    Hope this helps.




    XML is like violence. If it doesn't solve your problem, you're not using enough of it
    • Proposed as answer by liwaste Wednesday, July 27, 2011 9:04 PM
    Monday, July 11, 2011 1:43 PM