Is it possible to have a Line Chart that looks like a stair steps? The one close to this is the StepLineChart but uses dates in one of the axes.
Thanks for the very prompt response Georgi!!!
Hi,
At that moment that are not such kind of option, but maybe you could use one of these two options:
- Option 1: Using StepLineChart, but with formatting of your X axis. For example:
dt.Rows.Add(DateTime.Today.AddYears(1500).AddYears(- DateTime.Today.Year), 2); dt.Rows.Add(DateTime.Today.AddYears(2000).AddYears(-DateTime.Today.Year), 20); dt.Rows.Add(DateTime.Today.AddYears(3500).AddYears(-DateTime.Today.Year), 30); dt.Rows.Add(DateTime.Today.AddYears(4000).AddYears(-DateTime.Today.Year), 40); dt.Rows.Add(DateTime.Today.AddYears(4500).AddYears(-DateTime.Today.Year), 50); ultraChart1.Axis.X.TimeAxisStyle.TimeAxisStyle = Infragistics.UltraChart.Shared.Styles.RulerGenre.Discrete; ultraChart1.Axis.X.TickmarkIntervalType = Infragistics.UltraChart.Shared.Styles.AxisIntervalType.Years; ultraChart1.Axis.X.Labels.ItemFormat = Infragistics.UltraChart.Shared.Styles.AxisItemLabelFormat.Custom; ultraChart1.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL:yyyy>"; ultraChart1.DataSource = dt;
dt.Rows.Add(DateTime.Today.AddYears(1500).AddYears(- DateTime.Today.Year), 2);
dt.Rows.Add(DateTime.Today.AddYears(2000).AddYears(-DateTime.Today.Year), 20);
dt.Rows.Add(DateTime.Today.AddYears(3500).AddYears(-DateTime.Today.Year), 30);
dt.Rows.Add(DateTime.Today.AddYears(4000).AddYears(-DateTime.Today.Year), 40);
dt.Rows.Add(DateTime.Today.AddYears(4500).AddYears(-DateTime.Today.Year), 50);
ultraChart1.Axis.X.TimeAxisStyle.TimeAxisStyle = Infragistics.UltraChart.Shared.Styles.RulerGenre.Discrete;
ultraChart1.Axis.X.TickmarkIntervalType = Infragistics.UltraChart.Shared.Styles.AxisIntervalType.Years;
ultraChart1.Axis.X.Labels.ItemFormat = Infragistics.UltraChart.Shared.Styles.AxisItemLabelFormat.Custom;
ultraChart1.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL:yyyy>";
ultraChart1.DataSource = dt;
Option 2: Using a ScatterChart with property ConnectWithLines = true. By this way you could achieve similar result with small exceptions. Please take a look at the screenshot (red area).
Please if you have any questions, do not hesitate to write us
Regards