Stack Chart change datasource series type from candleStick to bar / line

3 posts, 0 answers
  1. Dragos
    Dragos avatar
    44 posts
    Member since:
    Dec 2015

    Posted 06 Jan Link to this post

    Hello , 

    Can anyone point me in some direction on how i may be able to  change the dataSource series types from candlestick to line or bar or area, or anything else than candlestick.

    Thank you in advance.

  2. Dragos
    Dragos avatar
    44 posts
    Member since:
    Dec 2015

    Posted 06 Jan in reply to Dragos Link to this post

    Just to be more precise i am talking about this example http://demos.telerik.com/kendo-ui/financial/index.

    And yes i have searched the documentation found here http://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/stock-chart. But i can't change the type only to "ohlc", and that is not what i want to do.

  3. Kendo UI is VS 2017 Ready
  4. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 08 Jan Link to this post

    Hello Dragos,

    Changing the StockChart series is not supported out-of-the-box, however as a workaround I would suggest using the chart.options and redrawing the chart:
    // get reference to the chart widget
    var chart =$("#stock-chart").data("kendoStockChart");
    // change the first series type
    chart.options.series[0].type="column";
    // change the first series field
    chart.options.series[0].field="Open";
    // redraw the chart
    chart.redraw();
    Keep in mind candlestick series expect Open, Close, High and Low fields, while bar / area expect only field.

    Regards,
    Iliana Nikolova
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top