Set "Smooth" Line Appearance in Code-Behind

3 posts, 0 answers
  1. Dave
    Dave avatar
    13 posts
    Member since:
    May 2012

    Posted 03 Sep 2014 Link to this post

    Hi,

    I have a line chart working with several line series that are generated and added to the RADHTMLChart from the Code-Behind.

    How can I set the LineAppearance to "Smooth" in the code-behind?

    I tried lineSeries1.LineAppearance.LineStyle = "Smooth" but I get an error: "LineAppearance" is read-only.

    Thanks.
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1502 posts

    Posted 08 Sep 2014 Link to this post

    Hello Dave,

    You must use the ExtendedLineStyle enum. For example:
    ASPX:
    <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="600px" Height="400px">
        <PlotArea>
            <Series>
                <telerik:LineSeries Name="Product 1">
                    <SeriesItems>
                        <telerik:CategorySeriesItem Y="15000" />
                        <telerik:CategorySeriesItem Y="23000" />
                        <telerik:CategorySeriesItem Y="10000" />
                    </SeriesItems>
                </telerik:LineSeries>
            </Series>
            <XAxis>
                <Items>
                    <telerik:AxisItem LabelText="1" />
                    <telerik:AxisItem LabelText="2" />
                    <telerik:AxisItem LabelText="3" />
                </Items>
            </XAxis>
        </PlotArea>
        <ChartTitle Text="Product sales for 2011">
        </ChartTitle>
        <Legend>
            <Appearance Position="Bottom" />
        </Legend>
    </telerik:RadHtmlChart>

    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        (RadHtmlChart1.PlotArea.Series[0] as LineSeries).LineAppearance.LineStyle = Telerik.Web.UI.HtmlChart.Enums.ExtendedLineStyle.Smooth;
    }



    Regards,
    Danail Vasilev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Dave
    Dave avatar
    13 posts
    Member since:
    May 2012

    Posted 11 Sep 2014 in reply to Danail Vasilev Link to this post

    Working great!

    Thanks.
Back to Top