I am trying to get a Composite chart with multiple line charts to display correctly.
The scenario is I have a date range from 11/1/2008 - 11/18/2008. Chart 1 has data for all the dates and chart 2 has data through the 16th. The problem is that the chart always stops at the 16th and does not show data for the 17th and 18th.
The code below has some commented lines where if I plot a value of 0 for those cases then the lines show up as 0. However I just want the line for Chart 2 to end and for Chart 1 to continue.
Here is the code I am using:
DataTable dt = m_PSSBO.StrategiesGetForDateRangeByStudentPlan(StudentPlanId, ChartDateStart.SelectedDate, ChartDateEnd.SelectedDate);
chartLegend.Bounds = new Rectangle(0, 83, 12, 15);
chartLegend.PE.ElementType = PaintElementType.Gradient;
chartLegend.PE.Fill = Color.CornflowerBlue;
chartLegend.Border.CornerRadius = 5;
chartLegend.Border.Thickness = 0;
StrategyEffectivenessUC.CompositeChart.Legends.Add(chartLegend);
StrategyEffectivenessUC.CompositeChart.ChartAreas.Add(chartArea);
axisX.OrientationType = AxisNumber.X_Axis;
axisX.SetLabelAxisType = SetLabelAxisType.ContinuousData;
axisX.LineThickness = 1;
axisX.Labels.Orientation = TextOrientation.VerticalLeftFacing;
axisY.OrientationType = AxisNumber.Y_Axis;
axisY.RangeMax = dt.Rows.Count;
axisY.RangeMin = 0;
axisY.LineThickness = 1;
axisY.TickmarkInterval = 1;
chartArea.Axes.Add(axisX);
chartArea.Axes.Add(axisY);
NumericSeries ns;
int count = 1;
{
chartlayerAppearance.ChartArea = chartArea;
chartlayerAppearance.AxisX = axisX;
chartlayerAppearance.AxisY = axisY;
DataTable dtDates = m_PSSBO.ChartStrategyGetForRange(StudentPlanId, strategyId, ChartDateStart.SelectedDate, ChartDateEnd.SelectedDate, false);
ns.Label = strategyId.ToString();
if (Convert.ToBoolean(drS["Used"]))
//else
// ns.Points.Add(new NumericDataPoint(0, drS["SessionDate"].ToString(), false));
}
lca.LineAppearances.Add(GetLineStyle(ratingValue));
chartlayerAppearance.ChartTypeAppearance = lca;
chartlayerAppearance.Series.Add(ns);
StrategyEffectivenessUC.CompositeChart.ChartLayers.Add(chartlayerAppearance);
chartLegend.ChartLayers.Add(chartlayerAppearance);
count++;
la.Thickness = 4;
la.LineStyle.DrawStyle = LineDrawStyle.Dash;
case 2:
break;
la.LineStyle.DrawStyle = LineDrawStyle.DashDotDot;
case 4:
la.LineStyle.DrawStyle = LineDrawStyle.Solid;
default:
more info: http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/Chart_Display_Data_on_a_Time_Scale_Axis.html
the X-axis uses the minimum number of points in all series to determine its range. try setting axisX.DataType = Time and creating NumericTimeSeries instead of NumericSeries for your data.