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

Radchart Xaxis textblock default text

1 Answer 94 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Sebastian Hermosilla
Top achievements
Rank 1
Sebastian Hermosilla asked on 07 Oct 2009, 06:16 PM
Hello
I have a chart wich in his xaxis textblok have dates,
I need this, when a date haven't data the xaxis texblock it display nothing.
I dont want use this
RadChart1.PlotArea.XAxis[3].TextBlock.Text = " ";
because the chart will have a lots of days (200 to 300) with empty values.
I need to know if there is a way to define a default value for the empty values.

Help please.


protected void Page_Load(object sender, EventArgs e) 
    { 
        if (!Page.IsPostBack) 
        { 
            RadChart1.PlotArea.XAxis.AutoScale = false
            RadChart1.PlotArea.XAxis.AddRange(1, 7, 1); 
             
            RadChart1.PlotArea.XAxis[0].TextBlock.Text = "lun"
            RadChart1.PlotArea.XAxis[1].TextBlock.Text = "mar"
            RadChart1.PlotArea.XAxis[2].TextBlock.Text = "mie"
            //RadChart1.PlotArea.XAxis[3].TextBlock.Text = " "; 
            //RadChart1.PlotArea.XAxis[4].TextBlock.Text = " "; 
            RadChart1.PlotArea.XAxis[5].TextBlock.Text = "sab"
            RadChart1.PlotArea.XAxis[6].TextBlock.Text = " "
 
  
 
            RadChart1.Series[0].Items.Add(new Telerik.Charting.ChartSeriesItem(1,0.1)); 
            RadChart1.Series[0].Items.Add(new Telerik.Charting.ChartSeriesItem(2,0.3)); 
            RadChart1.Series[0].Items.Add(new Telerik.Charting.ChartSeriesItem(3,1)); 
            RadChart1.Series[0].Items.Add(new Telerik.Charting.ChartSeriesItem(6,0.3)); 
   
 
        } 

1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 08 Oct 2009, 09:13 PM
Since you have defined a range between 1 and 7, you really don't have any empty values - there will always be a value there. You would probably have to define this manually as you are doing in the commented section since you are doing it from the code-behind.
Tags
Chart (Obsolete)
Asked by
Sebastian Hermosilla
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or