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

Chart of Time, include missing dates

1 Answer 103 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Indy asked on 18 May 2020, 02:21 PM


I am using the charting control.  I am plotting data over time, sometimes over days, weeks, months and years.  I would like th X axis (which shows time) on the graph to be sequential even if the data is not.  eg, if a week/month/year is missing it will plot a the item on the X axis but not have a value (hope that makes sense).  So effectively the chart looks like a timeline of data, the gaps shows missing data


Is this possible with the chart control?

Many thanks in advance





1 Answer, 1 is accepted

Sort by
Telerik team
answered on 20 May 2020, 02:30 PM

Hi Indy,

You can control the labels appearance of the XAxis by setting the step between the date. For example, you can have a similar setup:

        <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="640px" Height="480px">
                    <telerik:ColumnSeries DataFieldY="SellQuantity" >
                <XAxis BaseUnit="days" MinDateValue="05/10/2020" Step="1" Type="Date" DataLabelsField="SellDate"
                    EnableBaseUnitStepAuto="false" >
                    <LabelsAppearance DataFormatString="d" RotationAngle="45">
                    <TitleAppearance Text="Quantity">
                    <MajorGridLines Color="#EFEFEF" Width="1"></MajorGridLines>
                    <MinorGridLines Color="#F7F7F7" Width="1"></MinorGridLines>
            <ChartTitle Text="Sold Cars per Date">

    protected void Page_Load(object sender, EventArgs e)
        RadHtmlChart1.DataSource = GetData();

    protected DataTable GetData()
        DataTable dt = new DataTable();

        dt.Columns.Add("ID", typeof(int));
        dt.Columns.Add("SellQuantity", typeof(int));
        dt.Columns.Add("SellDate", typeof(DateTime));

        dt.Rows.Add(1, 2, new DateTime(2020, 05, 10));
        dt.Rows.Add(2, 5, new DateTime(2020, 05, 14));
        dt.Rows.Add(3, 6, new DateTime(2020, 05, 22));

        return dt;

Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Chart (HTML5)
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question