I have a dataset that I am trying to bind to a NumericSeries and display. One column is string type and is called Date and the other is double type called Value. I'm doing the following currently and does almost what I need with one exception.
NumericSeries valueSeries = new NumericSeries(); valueSeries.Data.DataSource = dt; valueSeries.Data.LabelColumn = "Date"; valueSeries.Data.ValueColumn = "Value"; valueSeries.DataBind(); ultraChart1.CompositeChart.Series.Add(valueSeries);
The problem that occurs is because my data may have duplicate's in the Date column. Like so:
Date | Value
12/1 | 25
12/1 | 27
When this is the case I end up with a duplicate label on the x-axis for the date 12/1 and the line still angles between these 2 points rather than being vertical as I need it. How can I make it understand that there may be essentially multiple x (date) values with different (y) value's that should be plotted at the same x location? Or is there some better way to do this? Thanks.
Try the NumericTimeSeries:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/Infragistics2.Win.UltraWinChart.v8.3~Infragistics.UltraChart.Resources.Appearance.NumericTimeSeries.html
I've tried the following:
NumericTimeSeries valueTimeSeries = new NumericTimeSeries(); valueTimeSeries.Data.DataSource = dt; valueTimeSeries.Data.TimeValueColumn = "Date"; valueTimeSeries.Data.ValueColumn = "Value"; valueTimeSeries.DataBind(); ultraChart1.CompositeChart.Series.Add(valueTimeSeries);
But get the an identically shaped line chart only without the labels on the x axis. If I put in the following line:
priceTargetTimeSeries.Data.LabelColumn = "Date";
Then I get exactly the same thing I had before (namely with duplicate labels and a line that is still not vertical). Am I missing something here? Thanks.
ultraChart1.LineChart.TreatDateTimeAsString property. For composite chart, you may have to set the Axis datatype to time.