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

Automatic percentage calculation

5 Answers 626 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 05 Jan 2015, 07:19 PM
From my understanding, Kendo chart can handle 2 kind of values:

-Absolute where the value represent the number of item matching a given category / subcategory. (Ex. Basic Area)
-Percent where the value is a percent (express in a 0.0 to 1.0 form) of item in a given category compare to siblings categories. (Ex: 100% Stacked area)

I've been dealing with Kendo chart for a couple of weeks and I just find out that the Pie Chart does some kind of internal conversion from absolute values to a percent values.  Indeed, if you give following value to a Pie Chart: category A = 2000, category B = 1000, category C = 1000, the Pie chart will calculate the right ratio for each categories and the chart will render with the expected 50% / 25% / 25% percentages.

My question is the following: If the charts has an internal way to calculate the percentage, is there a way to generate percent charts (like the 100% stacked area) by providing only the absolute values?

Best regards,

Simon





5 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 07 Jan 2015, 02:05 PM

Hi Simon,

I am not quite sure if I understand your scenario correctly - by design the 100% stacked chart generates percentage values from absolute. Could you please elaborate a bit more on the exact outcome you would like to achieve - this way I would be able to advice you further and provide concrete recommendations? 

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Simon
Top achievements
Rank 1
answered on 07 Jan 2015, 04:04 PM
Hello Iliana Nikolova,

I just find out what the problem is.  Indeed, chart will generate the percentage values from the absolute data provided.  As I forgot to change the way the min / max value are generated, I ended with a percent chart using a min / max value based on the absolute values.  Final result was an area with a value of 1 but displayed with on a scale of 250 000+

Transforming the data into a percentage solved my problem but obviously, it wasn't the right way to do it...  sorry about my early conclusions.

By the way, is there a way to set to min / max value of the chart to automatic (i.e. calculated by the chart itself based on the provided absolute values)?

Best regards,

Simon

0
Iliana Dyankova
Telerik team
answered on 09 Jan 2015, 02:15 PM

Hi Simon,

I am glad to hear the initial issue has been resolved. As for your other question, this is the default behavior of Kendo UI Chart - please take a look at this example and let me know if I am missing something?

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Simon
Top achievements
Rank 1
answered on 09 Jan 2015, 03:53 PM
Hello Iliana,

The example you provided is empty.
0
Iliana Dyankova
Telerik team
answered on 13 Jan 2015, 07:40 AM

Hi Simon,

Here is a basic example which demonstrates the discussed functionality - please check it and let me know if this helps.

Regards,
Iliana Nikolova
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Charts
Asked by
Simon
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Simon
Top achievements
Rank 1
Share this question
or