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

axis labels problem

1 Answer 184 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Amey
Top achievements
Rank 1
Amey asked on 04 Mar 2008, 06:40 AM
The code below is not able to show XAxis and YAxis labels despite setting all properties relevant to axis label.

        RadChart1.Width = 700;
        RadChart1.Height = 500;
        RadChart1.ChartTitle.TextBlock.Text = "Modalities QR Comparison";
        RadChart1.Skin = "WebBlue";
        RadChart1.PlotArea.YAxis.AutoScale = false;
        RadChart1.PlotArea.YAxis.MaxValue = 1.2000;
        RadChart1.PlotArea.YAxis.MinValue = 0.0000;
        RadChart1.PlotArea.YAxis.Step = 0.1000;
       
        RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = -90;
        RadChart1.PlotArea.Appearance.Dimensions.Margins.Left = 100;

        SqlConnection con = new SqlConnection();
        SqlCommand cmd = new SqlCommand();
        DataSet ds = new DataSet();
        string connstr = "Server=ZCONC;uid=sa;pwd=zcon@123;database=QMS_Feb20;Connect Timeout=30";
        string ConnectionString = connstr;
        con.ConnectionString = ConnectionString;
        cmd = con.CreateCommand();
        con.Open();
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.CommandText = "Department_Modalities_QR_Comparison";
        SqlDataAdapter ads = new SqlDataAdapter();
        cmd.Connection = con;
        ads.SelectCommand = cmd;
        ads.Fill(ds, "chart");
        con.Close();

        RadChart1.RemoveAllSeries();
        ChartSeries SR = RadChart1.CreateSeries("SR", Color.Fuchsia, Color.Fuchsia, ChartSeriesType.Bar);
        SR.DataYColumn = "SR";
        SR.Appearance.BarWidthPercent = 50;
        //QR.Appearance.TextAppearance.RotationAngle = -90;
        RadChart1.AddChartSeries(SR);
        RadChart1.PlotArea.XAxis.DataLabelsColumn = "ModalityTitle";

        DataView dv = ds.Tables[0].DefaultView;
        RadChart1.PlotArea.YAxis.AxisLabel.Visible = true;
        RadChart1.PlotArea.YAxis.AxisLabel.TextBlock.Visible = true;
        RadChart1.PlotArea.YAxis.AxisMode = ChartYAxisMode.Normal;
        RadChart1.PlotArea.YAxis.AxisLabel.Appearance.Dimensions.AutoSize = false;
        RadChart1.PlotArea.YAxis.AxisLabel.Appearance.Dimensions.Height = 20;
        RadChart1.PlotArea.YAxis.AxisLabel.Appearance.Dimensions.Width = 400;
        RadChart1.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.Position.Auto = true;
        RadChart1.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.None;
        RadChart1.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.Position.Y = 200;
        RadChart1.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.Position.X = 0;
        RadChart1.PlotArea.YAxis.AxisLabel.TextBlock.Text = "Qaisys Rating";


        RadChart1.DataSource = dv;
        RadChart1.DataBind();

What shall I do in order to display the chart axis labels?

1 Answer, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 06 Mar 2008, 04:45 PM
Hello Amey,

Please, review the following help articles which explain similar scenarios:

I hope the examples help!

Kind regards,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Chart (Obsolete)
Asked by
Amey
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Share this question
or