Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
325
Stair Steps LineChart with numeric x and y values
posted

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. 

 

 

Parents
  • 53790
    Verified Answer
    posted

    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;

      Your Quantity is added like an year to X axis minus current year. Please take a look at the attached sample and screenshot for more details.

    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

    UltraChartStepLineChart.zip
Reply Children
No Data