We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Chart is also showing chart where there is no data on xAxis(date axis)

This is same as earlier post with the subject line "date ranges with no data in the Essential charts". As this is very old post I have commented but not sure if I will get answer on that so postin this new thread.

I am having the problem to show Candle(sotck market data) chart for multiple days(almost 10 days) where daily data are from 09:30 am to 03:30pm. When I have this DataTable as a datasource and see the chart, it shows me complete 10 days data with the hugh gaps of not exist data like from 03:31 PM to next day 09:29AM which are not in DataTable. It shoould be like continuous graph where only data exist and continuous graph. 

Please let me know if this feature is already implemented.

Thanks in advance.

3 Replies

BR Brijesh December 10, 2022 02:24 PM UTC

I am attaching graph snapshot for the references.

Attachment: GapsInChart_51fd7b2c.zip

BR Brijesh December 10, 2022 02:37 PM UTC

I have also tried following code but still showing data.


chartControl1.PrimaryXAxis.MakeBreaks = true;

                chartControl1.PrimaryXAxis.BreakInfo.LineType = ChartBreakLineType.Straight;

                chartControl1.PrimaryXAxis.BreakInfo.LineSpacing = 15;

                chartControl1.PrimaryXAxis.BreakInfo.SpacingColor = Color.Orange;

                chartControl1.PrimaryXAxis.BreakRanges.BreaksMode = ChartBreaksMode.Manual;

                DateTime startDate = new DateTime(2022, 12, 5, 3, 30, 0);

                DateTime endDate = new DateTime(2022, 12, 6, 9, 15, 0);

                chartControl1.PrimaryXAxis.BreakRanges.Union(new DoubleRange(startDate.ToOADate(), endDate.ToOADate()));


I have MM:HH formate on X-Axis.

MD Moneeshram Dhanabal Syncfusion Team December 12, 2022 12:41 PM UTC

Hi Brijesh,

Query: Chart is showing gaps where there is no data on xAxis(date time axis).

To remove the gap on Date time axis, currently we can only achieve it by enabling the Indexed property of chart control as true. But we can slightly improve the performance by setting DrawGrid property of chart axis as false so that the time to draw the grid for each data label is reduced thus increasing the performance.

Please check this case and let us know if you need further assistance.



Live Chat Icon For mobile
Up arrow icon