RadChart XAxis steps

Thread is closed for posting
2 posts, 0 answers
  1. Sonia
    Sonia avatar
    90 posts
    Member since:
    Mar 2012

    Posted 12 Jul 2013 Link to this post

    I have used XAxis steps to ensure that ticks are placed every 1 step.

    ChartSeries serieIndicator = new ChartSeries("Indicator") { Type = ChartSeriesType.Line };
     
    serieIndicator.Items.Add(new ChartSeriesItem(0, 47));
    serieIndicator.Items.Add(new ChartSeriesItem(1, 35));           
    serieIndicator.Appearance.PointMark.Visible = true;
    serieIndicator.Appearance.PointMark.Border.Width = 2;
    serieIndicator.Appearance.PointMark.Border.Color = Color.RoyalBlue;
    serieIndicator.Appearance.PointMark.Dimensions.AutoSize = true;
    serieIndicator.Appearance.PointMark.Dimensions.SetDimensions(new Dimensions(6, 6));
    serieIndicator.Appearance.PointMark.Dimensions.AutoSize = false;
    serieIndicator.Appearance.PointMark.FillStyle.MainColor = Color.White;
    serieIndicator.Appearance.PointMark.FillStyle.FillType = FillType.Solid;
     
    RadChart1.Series.Add(serieIndicator);
     
    RadChart1.PlotArea.XAxis.AutoScale = false;
    RadChart1.PlotArea.XAxis.Step = 1;
     
    ChartSeries serieObjective = new ChartSeries("Objective") { Type = ChartSeriesType.Line };
    serieObjective.Appearance.PointMark.Visible = true;
    serieObjective.Appearance.PointMark.Border.Width = 2;
    serieObjective.Appearance.PointMark.Border.Color = Color.RoyalBlue;
    serieObjective.Appearance.PointMark.Dimensions.AutoSize = true;
    serieObjective.Appearance.PointMark.Dimensions.SetDimensions(new Dimensions(6, 6));
    serieObjective.Appearance.PointMark.Dimensions.AutoSize = false;
    serieObjective.Appearance.PointMark.FillStyle.MainColor = Color.White;
    serieObjective.Appearance.PointMark.FillStyle.FillType = FillType.Solid;
    serieObjective.Items.Add(new ChartSeriesItem(0, 20));
    serieObjective.Items.Add(new ChartSeriesItem(1, 40));
    serieObjective.Items.Add(new ChartSeriesItem(2, 60));
    serieObjective.Items.Add(new ChartSeriesItem(3, 80));
     
    RadChart1.Series.Add(serieObjective);

    However I cannot understand the resulting chart.
    Why seven steps if i only created chartseriesitem from 0 to 3?

    Thanks for your help,
    Sonia.
  2. Sonia
    Sonia avatar
    90 posts
    Member since:
    Mar 2012

    Posted 12 Jul 2013 Link to this post

    I discovered this can be forced by setting the min and max value.

    RadChart1.PlotArea.XAxis.MinValue = 0;
    RadChart1.PlotArea.XAxis.MaxValue = 3;
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top