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

Problems With Markedzone.

2 Answers 49 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Fabian Raul Jofre
Top achievements
Rank 2
Fabian Raul Jofre asked on 14 Sep 2009, 07:44 PM

Hello..
I need to know if i am doing something wrong with the marked zone at radchart.-
But i have a little problem.
If i set the DataLabelsColumn, the Markedzone doesn´t work, but if i comment this line everithing is ok with the markedzone.
The line is this -->RadChart1.PlotArea.XAxis.DataLabelsColumn = "DiasMes";


RadChart1.DataSource = dt;

RadChart1.PlotArea.XAxis.DataLabelsColumn =

"DiasMes";

 

RadChart1.DataBind();

 

foreach (ChartSeries oSerie in RadChart1.Series)

 

{

oSerie.Type =

ChartSeriesType.StackedArea;

 

oSerie.Appearance.LabelAppearance.Visible =

false;

 

 

}

 

 

 

ChartMarkedZone oMZ = new ChartMarkedZone();

 

oMZ.ValueStartX = 10;

oMZ.ValueEndX = 12;

oMZ.Appearance.FillStyle.MainColor = System.Drawing.

Color.Red;

 

RadChart1.PlotArea.XAxis.LabelStep = 1;

RadChart1.PlotArea.XAxis.MinValue = 1;

RadChart1.PlotArea.XAxis.MaxValue = MaxDayOfMonth;//int Value

RadChart1.PlotArea.MarkedZones.Add(oMZ);

RadChart1.DataBind();

2 Answers, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 17 Sep 2009, 12:01 PM
Hi Fabian,

Indeed, settng the AxisX.DataLabelsColumn property seems to override the marked zone settings and our developers will further investigate the issue. In the meanwhile , you can workaround the problem by handling the BeforeLayout event and manually add the axis labels:
RadChart1.BeforeLayout += new EventHandler<EventArgs>(RadChart1_BeforeLayout); 
 
    void RadChart1_BeforeLayout(object sender, EventArgs e) 
    { 
            RadChart1.PlotArea.XAxis.Items[0].TextBlock.Text = GetData().Rows[0][2].ToString(); 
            RadChart1.PlotArea.XAxis.Items[1].TextBlock.Text = GetData().Rows[1][2].ToString(); 
            RadChart1.PlotArea.XAxis.Items[2].TextBlock.Text = GetData().Rows[2][2].ToString(); 
 
Attached is a sample project.

Hope this will help.

Regards,
Velin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Fabian Raul Jofre
Top achievements
Rank 2
answered on 17 Sep 2009, 03:29 PM
Thank´s that´s solucionated my problem.
Tags
Chart (Obsolete)
Asked by
Fabian Raul Jofre
Top achievements
Rank 2
Answers by
Velin
Telerik team
Fabian Raul Jofre
Top achievements
Rank 2
Share this question
or