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

How to remove the gap in the chart?

1 Answer 70 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
diandian82 asked on 02 Jun 2011, 04:14 PM

Hello folks,

Recently i got a problem when display the RadChart by using CandleStickSeriesDefinition.

The definition of the series is as follows,

_mainSeriesMapping.SeriesDefinition = new CandleStickSeriesDefinition();
            _mainSeriesMapping.SeriesDefinition.Appearance.StrokeThickness = 1;
            _mainSeriesMapping.SeriesDefinition.Appearance.Stroke = new SolidColorBrush(Colors.Green);
            _mainSeriesMapping.SeriesDefinition.Appearance.Fill = new SolidColorBrush(Colors.Green);
            _mainSeriesMapping.SeriesDefinition.ShowItemToolTips = true;
            var imHigh = new ItemMapping("HighPrice", DataPointMember.High);
            var imLow = new ItemMapping("LowPrice", DataPointMember.Low);
            var imOpen = new ItemMapping("OpenPrice", DataPointMember.Open);
            var imClose = new ItemMapping("ClosePrice", DataPointMember.Close);
            var imXDate = new ItemMapping("ProcessDateTime", DataPointMember.XValue);
            var imYDate = new ItemMapping("ClosePrice", DataPointMember.YValue);

Then I bind to the my entity and got the picture as the attached file.

In the middle, there is a big gap, this is because in those two days(AxisX) are weekend and has no data. I just want to know how can i remove those weekend days in the chart and got the continuous data.

Thanks very much for your help.

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 07 Jun 2011, 06:59 AM

Presently, the way to solve this issue would be to remove the entries from the underlying datasource. For example, if the control is bound to a field for its .XCategoty/.XValue. Then, if in out of 100 values, the ones in positions from 20 to 45 have no data, you can simply remove them, and pass a datasource to the chart, which contains no empty points. In this way, the data will be visually continuous.
I hope this gets you started properly.

Best wishes,
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question