Answered Uneven X-Axis marks in line chart

  • Thursday, April 26, 2012 5:37 PM
     
     
     

    I'm trying to use a new ASP.NET MS Chart to draw a line chart.

    The problem is I cannot build uneven X-Axis marks though I supply X-values with different step. It draws X-marks with some even step I didn't supply. I used Auto property expecting to show ticks according to X-values I submit.

    Is it possible to draw only supplied X-value marks?

    Thanks,

    Sergei


All Replies

  • Friday, April 27, 2012 8:33 AM
    Moderator
     
     

    Make sure your x values are not Strings and that Series.IsXValueIndexed is false.

    If you still can't get it to work, please post a piece of code, data and a picture to clarify the problem.

  • Friday, April 27, 2012 2:53 PM
     
     

    Please see my C# example (it's still the same problem):

    int[] x_int = {1,31,91,270,10000};
    double[] y_double = {10.0,-30.0,151.0,-21.0,300.0};
    chart_.Series[0].IsXValueIndexed = false;
    for (int i=0;i<x_int.Length; i++)
    {
          chart_Series[0].Points.AddXY(x_int[i], y_double[i]);
    }

    I don't know how to attach the picture, but it still dispays regular X-mesh.

    Thanks

  • Friday, April 27, 2012 5:21 PM
    Moderator
     
     Answered

    I'm not sure what the problem here is..

    You might in fact need to set the IsXValueIndexed to true after all.

    Or perhaps you want a logarithmic axis? In which case you need to set Axis.IsLogarithmic to true.

    To add a picture, use the "Insert image" button on the post edit toolbar (the rightmost button.)

    • Marked As Answer by Sergei Chedrin Friday, April 27, 2012 6:09 PM
    •  
  • Friday, April 27, 2012 6:10 PM
     
     

    IsXValueIndexed to true at the end solved my problem.

    Thanks a lot