This is a migrated thread and some comments may be shown as answers.

Chart Series not centered when ChartXAxis.LabelStep > 1

1 Answer 42 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Siddhesh
Top achievements
Rank 1
Siddhesh asked on 27 Sep 2012, 10:07 PM
Hello,
When using LabelStep for ChartXAxis, the resulting image does not have the axis lines centered at the step interval.  Is there any way to override this behavior and make lines centered at the interval.

I am using the following code

// X Axis properties
chart.PlotArea.XAxis.VisibleValues = ChartAxisVisibleValues.Positive;
chart.PlotArea.XAxis.Step = 1;
chart.PlotArea.XAxis.LabelStep = 2;
chart.PlotArea.XAxis.IsZeroBased = false;
chart.PlotArea.XAxis.AutoScale = false;
chart.PlotArea.XAxis.Appearance.ValueFormat = ChartValueFormat.General;

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 01 Oct 2012, 11:40 AM
Hi Siddhesh,

I suggest that you tweak the LayoutMode of the XAxis in order to achive better visualization.  Let me know whether this works for you and if not please provide some more information on your scenario - whether you have used a DataLabelsColumn for the XAxis dates or you have added the series items manually similar to this way :

ChartSeries serie = new ChartSeries();
 serie.Type = ChartSeriesType.Line;
      foreach (Product product in products)
       {
          ChartSeriesItem item = new ChartSeriesItem();
          item.YValue = (double)product.QuantityInStock;
          item.XValue = product.Date.ToOADate();
          item.Name = (string)product.Name;
          serie.Items.Add(item);
       }
RadChart1.Series.Add(serie);

Kind regards,
Evgenia
the Telerik team

If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Chart (Obsolete)
Asked by
Siddhesh
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or