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";
                
    this.chart1.Series.Add(s);
  2. Ves
    Admin
    Ves avatar
    2879 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,
    Ves
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. 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.
  5. Giuseppe
    Admin
    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"
        <Series> 
            <telerik:ChartSeries Type="CandleStick" DataYColumn="Open" DataYColumn2="Close" DataYColumn3="Max" 
                DataYColumn4="Min"
            </telerik:ChartSeries> 
        </Series> 
    </telerik:RadChart> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
        SelectCommand="SELECT [Open], [Close], [Max], [Min] FROM [CandlestickData]"></asp:SqlDataSource> 



    Sincerely yours,
    Manuel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. 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!
  7. Ves
    Admin
    Ves avatar
    2879 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,
    Ves
    Telerik
    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
UI for ASP.NET Ajax is Ready for VS 2017