locked
Chart Type "Column" and x = 0 RRS feed

  • Question

  • Hi all!

    Problem:

    Chart with ChartType "Column" does not display DataPoint (0,10) at x-Axis correctly.

    The DataPoint is displayed at x-Axis value 1 and not 0! With ChartType "Line" it works.

    Example:

    chart1.Series[0].ChartType = SeriesChartType.Column;
    chart1.ChartAreas[0].AxisX.Minimum = -5D;
    chart1.ChartAreas[0].AxisX.Maximum = 5D;
    chart1.ChartAreas[0].AxisX.Interval = 1D;
    chart1.ChartAreas[0].AxisX.IsStartedFromZero = false;
    
    chart1.Series["Series1"].Points.AddXY(0D, 10D); // displayed at x = 1

    What is missing?

    -Lars

    Thursday, August 2, 2012 9:01 AM

Answers

  • I tried to explain this in the FAQ, here.

    Though I'm pretty sure it's not working with the Line chart type either. I don't know how you managed that. One point on a line chart won't be visible at all, unless you specify a marker. And, based on what I just tested, a line chart will also draw that marker at x = 1.

    • Proposed as answer by siplaModerator Thursday, August 2, 2012 10:12 AM
    • Marked as answer by siplaModerator Thursday, August 9, 2012 8:57 AM
    Thursday, August 2, 2012 9:11 AM
    Moderator

All replies

  • I tried to explain this in the FAQ, here.

    Though I'm pretty sure it's not working with the Line chart type either. I don't know how you managed that. One point on a line chart won't be visible at all, unless you specify a marker. And, based on what I just tested, a line chart will also draw that marker at x = 1.

    • Proposed as answer by siplaModerator Thursday, August 2, 2012 10:12 AM
    • Marked as answer by siplaModerator Thursday, August 9, 2012 8:57 AM
    Thursday, August 2, 2012 9:11 AM
    Moderator
  • Thank you very much!

    I've solved this problem by adding a new series (dummy) with Color.Transparent and insert DataPoint (1,1)

    -Lars

    • Proposed as answer by Naomi N Tuesday, August 21, 2012 9:59 AM
    Thursday, August 2, 2012 9:21 AM