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

Displaying AxisY in Right unsig Multiple Y-axes

3 Answers 53 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
EssMus
Top achievements
Rank 1
EssMus asked on 04 May 2015, 09:54 AM

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

 

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 05 May 2015, 11:52 AM
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.

 
0
EssMus
Top achievements
Rank 1
answered on 06 May 2015, 01:17 PM

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 

0
Danail Vasilev
Telerik team
answered on 07 May 2015, 08:30 AM
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.

 
Tags
Chart (HTML5)
Asked by
EssMus
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
EssMus
Top achievements
Rank 1
Share this question
or