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

Skip Plotted graph for mssing data

1 Answer 55 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Pradyumna
Top achievements
Rank 1
Pradyumna asked on 25 Oct 2010, 07:59 PM
Hi,

I would like to know if there is any way to skip the plotting of graph for missing data. My x-axis is of shortdate and y-axis is numeric. The values on the x-axis range from 9/1 to 10/9. my step value on x-axis is 1 day so it plots 1 gridline for each point(1 day). Now, my dataset does not have any items with values for certain dates but it still gets plotted on the x-axis because of the min and max values given to x=axis. Is there any way to suppress the plotting of this x-axis label, if the data set doesn't contain the data? Also, the labels overlap. The date range is 9/5 - 10/9 Attaching chart for your ref.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 27 Oct 2010, 11:02 AM
Hi Pradyumna,

You can't restrict certain Chart values from appearing. What I suggest you is to use Empty Values feature (http://www.telerik.com/help/aspnet-ajax/featuresemptyvalues.html) of RadChart and set certain points of Line chart as Empty. You can find example of chart with Empty Values with source code in our demos - http://demos.telerik.com/aspnet-ajax/chart/examples/newfeatures/emptyvalues/defaultcs.aspx.
You have complete control over the visual style of empty values. Set their Color to Transparent to make them invisible like this:
ChartSeries s1 = new ChartSeries("Series 1", ChartSeriesType.Line);
s1.Appearance.EmptyValue.Line.Color = System.Drawing.Color.Transparent;
Have in mind that you should set Yvalue for every XValue date to be able to use Empty Values feature.

You can get rid of label overlapping by rotating the Item Labels of XAxis 90 degrees for example.
Here is how you can achieve this:
<telerik:RadChart ID="RadChart1" runat="server"
            <PlotArea
                <XAxis
                    <Appearance
                    <LabelAppearance RotationAngle="90"></LabelAppearance
                    </Appearance
                </XAxis
            </PlotArea
        </telerik:RadChart>
Use an additional setting, which will improve the text quality for the rotated labels:
RadChart1.Appearance.TextQuality = Telerik.Charting.Styles.TextQuality.AntiAlias;

Regards,
Evgenia
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
Tags
Chart (Obsolete)
Asked by
Pradyumna
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or