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

Set "Smooth" Line Appearance in Code-Behind

2 Answers 206 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 03 Sep 2014, 09:31 PM
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 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 08 Sep 2014, 10:38 AM
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.

 
0
Dave
Top achievements
Rank 1
answered on 11 Sep 2014, 03:26 PM
Working great!

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