axis labels problem

Thread is closed for posting
2 posts, 0 answers
  1. Amey
    Amey avatar
    16 posts
    Member since:
    Feb 2008

    Posted 04 Mar 2008 Link to this post

    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?
  2. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 06 Mar 2008 Link to this post

    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
Back to Top