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

Different label for an x or y axis with the Bubble Chart

4 Answers 299 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Spartan IV
Top achievements
Rank 1
Spartan IV asked on 19 Sep 2012, 05:08 AM
The Bubble chart uses xField and yField and they must be numeric values to work. If I try to use a non numeric value, the chart doesn't render. Is it possible to have Something like this:



xField = id



id, description

1, A

2, B

3,C

4,D



I want A, B, C, D and not the id, but I need to use the id at the xField for the Bubble Chart to render



Is it possible even though using id as the x field, to NOT display the id value on the xAxis and show the related description instead with the Bubble Chart?



I've tried using #= dataItem.description # as the label template but it throws an exception



Data is returned back in JSON format.



Thanks







4 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 21 Sep 2012, 03:43 PM
Hi Alexis,

I am afraid what you are trying to achieve is not supported in Kendo UI Bubble Chart. In order to achieve it you can try a custom implementation. As a possible approach I can suggest to use a template for the labels on the xAxis and create a function which sets a custom text/description.
 
Kind regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Spartan IV
Top achievements
Rank 1
answered on 21 Sep 2012, 05:24 PM
At least for this situation I found a workaround

What I did is I created a javascript associative array

var valueArray = new Array();
valueArray[1] = "A";
valueArray[2] = "B";
valueArray[3] = "C";
valueArray[4] = "D";

or you create a function using ajax to call the server and get the values, and populate the array dynamically

Then I use a template

  xAxis: {
                        title: {
                            text: "My Chart"
                        },
                          
                        labels: {
                            //format: "{0:N0}",                            
                            rotation:90,
                            template: "#= changeXLabels(value) #"
                        }
}

Then on my javascript

function changeXLabels(value) {  
          var myValue = Math.floor(value);              
          return valueArray[myValue] == undefined ? "" : valueArray[myValue];
      }


This returns the actual string associated with the numeric value and the label gets changed. So even though the xAxis (also works with the yAxis) is numeric, I can set text labels on the axis

I hope this helps other people with the same need.

Thanks
0
Jaime Bula
Top achievements
Rank 2
answered on 26 Jul 2017, 04:39 PM
Hi Iliana, this shortage of functionality is getting pretty common with Telerik Controls. Everything is being left for us to solve, that is not the idea of buying a control suite. 
0
Dimo
Telerik team
answered on 01 Aug 2017, 11:40 AM
Hello Jaime,

My name is Dimo Dimov and I am the support lead at Kendo UI.

I reviewed your recent support history and need to admit that the customer experience has not been smooth, due to a few unavailable features and issues. I realize the effect such an accumulation of cases may have and from this point of view, I agree your disappointment is justified.

While our feature roadmap and priorities depend largely on the business value and customer demand for specific functionality, the ThemeBuilder bug has indeed persisted more than enough. I discussed the matter with the dev team and they will look into it in the following week.

We value customer feedback and will appreciate if you share what is important for your business in the future as well.

Regards,
Dimo
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Charts
Asked by
Spartan IV
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Spartan IV
Top achievements
Rank 1
Jaime Bula
Top achievements
Rank 2
Dimo
Telerik team
Share this question
or