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

Bind the string values in X axis

4 Answers 180 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Giri
Top achievements
Rank 1
Giri asked on 19 Sep 2008, 01:43 PM
Hi,

     How to bind the string values in the x axis? .I already see one of u r previous example that to set the autoscale property for the x axis to false.Then set the text property to the corresponding axis.In u r example i saw that u done all these property settings within the PlotArea.But in my  plotarea i didn't get this Xaxis within this area.So what's this problem is this due to any version problem or anything else.In the aspx page i add the assembly like this in top of my design page

%@ Register TagPrefix="radc" Namespace="Telerik.WebControls" Assembly="RadChart.Net2" %>
<%@ Register TagPrefix="radc" Namespace="Telerik.Charting" Assembly="RadChart.NET2" %>

           Here in my rad chart control i am also didn't get the autowraptext property .

What's the solution for this?
Help me immediately.....

4 Answers, 1 is accepted

Sort by
0
Matthew Bishop
Top achievements
Rank 1
answered on 20 Sep 2008, 09:51 AM
Giri, unless I miss my guess, your using the old version of the controls, not version 2.0.4.0 for .net 3.5 right?
Because the new assembly code looks like this:

<%

@ Register assembly="Telerik.Charting, Version=2.0.4.0, Culture=neutral, PublicKeyToken=d14f3dcc8e3e8763" namespace="Telerik.Charting" tagprefix="telerik" %>


If so, i took a look at some of my old code and I used this,

 

ArrayList

d1 = new ArrayList();
d1.Add(
"blah 1");
d1.Add(
"blah 2");
d1.Add(
"blah 3");
d1.Add(
"blah 4");
for(int i=0;i!=d1.Count;i++)
{
RadChart1.XAxis.AddItem(d1[i].ToString());
}

0
Giri
Top achievements
Rank 1
answered on 22 Sep 2008, 05:48 AM
Hi Matthew,
             
                   I am using older version of RadChart.That'swhy i didn't get some of the properties.Now i am clear in this problem.Thanks for u r help.Then i have another problem in my chart.In my chart a series have four bars when i click the particular bar i want to take the X label text of that particular bar.Here in this chart i am binding the string values for x axis so each bar has different label in its axis.I know it will write in the chart click event but i don't know how to take the particular x label text.

Give me a suggestion
Thanks ,
0
Matthew Bishop
Top achievements
Rank 1
answered on 22 Sep 2008, 05:54 AM
Hi Giri,
your in luck, i think i just doing what you want right now! so try this. Create the click event by dbl clicking on the chart in the designer then this should work:

protected

void RadChart1_Click(object sender, ChartClickEventArgs args)
{
if (args.SeriesItem != null)
{
RadAjaxManager1.Alert(RadChart1.ChartTitle.TextBlock.Text.ToString() +
"\\n" + args.Series.ToString() + "\\n" + RadChart1.PlotArea.XAxis.Items[args.SeriesItem.Index].TextBlock.Text);
}
}

That should give you the Chart name, the series name of what was clicked, and the xaxis value.
Hope it helps :)

0
Giri
Top achievements
Rank 1
answered on 22 Sep 2008, 08:48 AM
Hi Matthew,

               What a coincidence.....Great u r codings are very helpful to me.Now i am getting the x axis label value correctly.

Thanks,
Tags
Chart (Obsolete)
Asked by
Giri
Top achievements
Rank 1
Answers by
Matthew Bishop
Top achievements
Rank 1
Giri
Top achievements
Rank 1
Share this question
or