CandleStick Chart creation

Thread is closed for posting
6 posts, 0 answers
  1. Michael
    Michael avatar
    3 posts
    Member since:
    Feb 2008

    Posted 30 May 2008 Link to this post

    Does anyone have any sample code to create a candlestick chart through code.  I've got the date in a datatable and i'm trying to configure the chart.  

    ChartSeries s = new ChartSeries();
                s.Type = ChartSeriesType.CandleStick;
                s.DataLabelsColumn = "Date";
                s.DataYColumn = "Open";
                s.DataYColumn2 = "High";
                s.DataYColumn3 = "Low";
                s.DataYColumn4 = "Close";
  2. Ves
    Ves avatar
    2914 posts

    Posted 02 Jun 2008 Link to this post

    Hi Michael,

    I am afraid this is a bug in RadChart -- the control throws an exception when databinding a candlestick series. Our developers are already aware of this. Please, accept our apologies for the inconvenience caused.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. MikeK
    MikeK avatar
    46 posts
    Member since:
    Oct 2007

    Posted 12 Nov 2008 Link to this post

    Does this control work with a SQL Datasource or does the bug prevent this from binding?

    Do you have an example of this available? I think bound the control correctly but I'm getting an error:  CandleStick series requires all Y values to be set.
  4. Giuseppe
    Giuseppe avatar
    2363 posts

    Posted 14 Nov 2008 Link to this post

    Hello MikeK,

    You can databind a candlestick by creating a chart series, setting the Type property and setting the respective DataYColumn - DataYColumn4 property values in the following order: Open-Close-Max-Min:

    <telerik:RadChart ID="RadChart1" runat="Server" AutoLayout="true" DataSourceID="SqlDataSource1"
            <telerik:ChartSeries Type="CandleStick" DataYColumn="Open" DataYColumn2="Close" DataYColumn3="Max" 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
        SelectCommand="SELECT [Open], [Close], [Max], [Min] FROM [CandlestickData]"></asp:SqlDataSource> 

    Sincerely yours,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Gergo
    Gergo avatar
    2 posts
    Member since:
    May 2013

    Posted 30 May 2013 Link to this post

    Ok It works in aspx but still not work in C#. The error is the same:
    "CandleStick series requires all Y values to be set."

    The last post was in 2008 and I've still get this error in 2013?!?!

    Please help me!
  6. Ves
    Ves avatar
    2914 posts

    Posted 05 Jun 2013 Link to this post

    Hey Sergo,

    Find attached a small example, showing programmatically created CandleStick series with SqlDataSource (using Northwind).

    Best regards,
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top