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
290
LineChart displays only 15 colums of series
posted

Hi,

I'm using WinChart 9.1 and want to display a NumericTimeSeries with the date-value on the x-axis and the amount on y-axis. Everything is fine, but after 15 columns the chart ends on the x-axis and no bigger values are displayed.

Thanks a lot,

Alex

  • 290
    posted

    Hi again,

    I tried something out and now I guess, it is because of the interval-settings. I don't know exactly what setting it is but the chart has simply not enough space to draw all of the days on x-axis and stops at the 16th day. A better behaviour would be, if it tried to draw all days of the series and changed the interval on the axis but now I'll do this manually. Probably this is the solution.

    Alex

  • 26458
    Offline posted

    The chart shouldn't normally have any trouble displaying a large amount of data. Perhaps something is preventing it from doing so. Here's a few things you can check:

    if you have more than one series, make sure that each series has an equal amount of points. Otherwise, you have to use a composite chart.

    Make sure that you're not setting a range on the X axis. Check chart.Axis.X.RangeMin/RangeMax/RangeType properties

    As a sanity check try this code and see if it works:

    DataTable dt = new DataTable();
    dt.Columns.Add("date", typeof(DateTime));
    dt.Columns.Add("value", typeof(double));
    dt.Columns.Add("label", typeof(string));

    for (int i = 0; i < 50; i++)
    {
       dt.Rows.Add(DateTime.Now.AddDays(i), i, "label " + i);
    }

    NumericTimeSeries series = new NumericTimeSeries();
    series.Data.DataSource = dt;
    series.Data.TimeValueColumn = "date";
    series.Data.LabelColumn = "label";
    series.Data.ValueColumn = "value";
    series.DataBind();

    ultraChart1.ChartType = ChartType.LineChart;
    ultraChart1.LineChart.TreatDateTimeAsString = false;
    ultraChart1.Series.Add(series);