Linechart with linqdatasource

2 posts, 1 answers
  1. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 02 Jun 2015 Link to this post

    I have been looking for a working example of a LINE CHART that uses a linqdata source.  They have an example of a bar chart, and I changed out the series type with a telerik:lineseries and it is just not working.  


    I am sure I am just missing something very easy here...  Does anyone know of an example combining these two?

    This should be stupid easy I would think.




  2. Answer
    Danail Vasilev
    Danail Vasilev avatar
    1476 posts

    Posted 02 Jun 2015 Link to this post


    I have have already replied to the support ticket that was opened by you on the matter, so that I paste my answer for the rest of the community:

    You can find the modification of this demo (, so that a line series is bound to LinqDataSource:

    <asp:LinqDataSource ID="LinqDataSource1" runat="server" OnSelecting="LinqDataSource1_Selecting">


    <div class="demo-container size-wide">

        <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="800px" Height="500px"




                    <telerik:LineSeriesDataFieldY="UnitsInStock" Name="Units In Stock">

                        <TooltipsAppearance Visible="false"></TooltipsAppearance>


                    <telerik:ColumnSeries DataFieldY="UnitsOnOrder" Name="Units On Order">

                        <TooltipsAppearance Visible="false"></TooltipsAppearance>



                <XAxis DataLabelsField="ProductName">


                    <MajorGridLines Visible="false"></MajorGridLines>

                    <MinorGridLines Visible="false"></MinorGridLines>



                    <TitleAppearance Text="Units"></TitleAppearance>

                    <MinorGridLines Visible="false"></MinorGridLines>



            <ChartTitle Text="Products Balance">





    protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e)


        NorthwindReadOnlyEntities northwindContext = new NorthwindReadOnlyEntities();

        e.Result = northwindContext.Products.Where(p => p.UnitsOnOrder > 0).Where(p => p.UnitsInStock > 0).Take(5);


    The above chart renders like that -

    You can find the live demos in the installation folder of Telerik UI controls. For example here:

    C:\Program Files (x86)\Telerik\UI for ASP.NET AJAX Q1 2015\Live Demos

    Let me know if you have any questions on the matter.

    Danail Vasilev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top