Displaying AxisY in Right unsig Multiple Y-axes

4 posts, 0 answers
  1. EssMus
    EssMus avatar
    18 posts
    Member since:
    Jan 2015

    Posted 04 May 2015 Link to this post

    hi,

    i want to display AxisY in the right in the pic i have Axis Y wich is have green color i bind my chart programmatically this is my code 

     

     SqlConnection con = new SqlConnection(@"Data Source=.;Initial Catalog=DB_WEB_Q_TEL;Integrated Security=True");
                string req = "select time_tag,[ain_sebou|Niveau] as AIN_SEBOU_NIVEAU , [allal_fassi|Niveau]as ALLAL_FASSI_NIVEAU  from QTSW_DATA1 where time_tag between ('01/01/2015') AND ('20/01/2015')";
                DataSet DS = new DataSet();
                con.Open();
                if (DS.Tables.Contains("TRChart"))
                {
                    DS.Tables.Remove("TRChart");
                }
                SqlDataAdapter da = new SqlDataAdapter(req, con);
                da.Fill(DS, "TRChart");
                con.Close();

                RadHtmlChart chart = new RadHtmlChart();

                chart.DataSource = DS.Tables["TRChart"];
                chart.DataBind();

     

    ScatterLineSeries SL = new ScatterLineSeries();
                SL.DataFieldX = "time_tag";
                SL.DataFieldY = "AIN_SEBOU_NIVEAU";
                SL.MarkersAppearance.Visible = false;

                SL.TooltipsAppearance.DataFormatString = " {1} at {0:dd-MM-yyyy HH:mm}";
                SL.LabelsAppearance.Visible = false;
                chart.PlotArea.XAxis.LabelsAppearance.DataFormatString = "{0:dd-MM-yyyy HH:mm}";
                chart.PlotArea.XAxis.LabelsAppearance.RotationAngle = 90;

                chart.PlotArea.XAxis.BaseUnit = Telerik.Web.UI.HtmlChart.DateTimeBaseUnit.Days;
                chart.PlotArea.XAxis.DataLabelsField = "time_tag";
                chart.PlotArea.Series.Add(SL);
               

                // serie2
                ScatterLineSeries SL1 = new ScatterLineSeries();
                SL1.AxisName = "Additional";
                SL1.DataFieldX = "time_tag";
                SL1.DataFieldY = "ALLAL_FASSI_NIVEAU";
                SL1.MarkersAppearance.Visible = false;

                SL1.TooltipsAppearance.DataFormatString = " {1} at {0:dd-MM-yyyy HH:mm}";
                SL1.LabelsAppearance.Visible = false;
                chart.PlotArea.XAxis.LabelsAppearance.DataFormatString = "{0:dd-MM-yyyy HH:mm}";
                chart.PlotArea.XAxis.LabelsAppearance.RotationAngle = 90;

                chart.PlotArea.XAxis.BaseUnit = Telerik.Web.UI.HtmlChart.DateTimeBaseUnit.Days;

                chart.PlotArea.Series.Add(SL1);
                //chart.PlotArea.XAxis.Visible = false;
                AxisY ax = new AxisY();
                ax.Name = "Additional";
                ax.Color = Color.Green;
                ax.Width = 2;

              
                chart.PlotArea.AdditionalYAxes.Add(ax);

    pls i need help very quickly

     

  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 05 May 2015 Link to this post

    Hi Essoufi,

    You can set a particular crossing point for the x-axis, as illustrated here - http://demos.telerik.com/aspnet-ajax/htmlchart/examples/functionality/multipleyaxes/defaultcs.aspx

    Regards,
    Danail Vasilev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. EssMus
    EssMus avatar
    18 posts
    Member since:
    Jan 2015

    Posted 06 May 2015 in reply to Danail Vasilev Link to this post

    hi Danail Vasilev,

    i have seen your url and i understand to make AxisY in the right you must add this code 

     <XAxis>                    <AxisCrossingPoints>                        <telerik:AxisCrossingPoint Value="0" />                        <telerik:AxisCrossingPoint Value="4" />                    </AxisCrossingPoints>

    this's in page.aspx but me i want to do it programmatically and thank you for answerring me 

  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 07 May 2015 Link to this post

    Hello Essoufi,

    You can use the same property and tag names from the markup for the programmatic creation of the chart as well.

    You should, however, add the Telerik.Web.UI namespace to page, in order to get the intellisense for the control.

    Regards,
    Danail Vasilev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top