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

candlestick chart for non financial purpose

1 Answer 155 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sayu
Top achievements
Rank 1
Sayu asked on 26 Nov 2012, 08:44 AM
Hi,
I was trying to use the candle stick chart for non financial data. Basically, I was trying to use the chart in place of a box n whiskers chart.
So I tried using kendochart instead of kendoStockChart and set the chart type to "candlestick" and it worked! However, since I was using kendoChart, I was not able to zoom on the chart using mouse scroll. 
I referred to the link  http://www.kendoui.com/forums/dataviz/general-discussions/zoom-example.aspx for implementing my own zoom but I was not able to get the axis correctly.
I have two questions:
1. In case I use kendoChart for candlestick chart, how can I get the x Axis correctly?
2. Is there a way to use the kendoStockChart for non financial applications? Basically, my X axis wont be dates and could be patients.

Code snippet which I wrote is as under:
var title = $("#paramDropDown").data("kendoDropDownList").dataItem();
               $("#boxplot").kendoChart({
                        theme: $(document).data("kendoSkin") || "default",
                        dataSource: {
                            data: obj
                        },
                        title: {
                            text: title
                        },
                        series: [{
                            type: "candlestick",
                            openField: "q1Val",
                            highField: "maxVal",
                            lowField: "minVal",
                            closeField: "q3Val"
                        }],
                        
                        transitions: false,
                        drag: onDrag,
                        zoom: onDrag
                        
                  });

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 29 Nov 2012, 12:41 PM
Hi,

Thank you for bringing this question up.

The candlestick chart is a categorical and requires a bit different approach.

The category axis itself has no range (min & max) so we can't filter the axis itself. Well, the date category axis does have a range, but it is a special case. In the general case we need to filter the data source. I've prepared a modified demo over here: http://jsbin.com/omemom/3

It works by assigning indices to the categories and filtering the data source by those indices.

On a second thought, adding a min/max options that work with indices to the category axis makes sense. We'll consider this for the next version.

All the best,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Sayu
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or