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

Chart axis is buggy for logarithmic type(="log")

4 Answers 388 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dinko
Top achievements
Rank 1
Dinko asked on 29 Mar 2018, 08:05 AM

Hi,

I have stumbled upon two issues when the axis in set to type="log"

The first it that the (X) axis is reversed for some reason. Using "reverse='true'" does nothing to the axis.

The second issue is the axisCrossingValue. For some reason it is not the default 0 but some number bigger than 0 selected by some unclear method. Could you please at least document how that is picked? And why it is not the smallest value in the series?

See issues here https://plnkr.co/edit/zwT7PosqasUqZsJsuEf6?p=preview

4 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 29 Mar 2018, 12:39 PM
Hello Dinko,

Logarithmic axis is a special numeric axis that transforms the actual values by using a logarithmic function with a particular base. Logarithmic axis is useful for displaying values that cover different orders of magnitude because it lets large values display together with small values in a more condensed scale than the default linear axis. The base of the logarithmic axis is defined by the interval between the major divisions, controlled by the majorUnit property.

As the base 100 logarithm of 1 is 0, the default axisCrossingValue, the Y-axis appears where the value of the logarithmic axis is 1 (1 is the default crossing value for logarithmic axes as the base-any-number logarithm of 1 is 0):

https://plnkr.co/edit/pHlKu8g0iYgigOFXPrs9?p=preview

The reverse property is working as expected on my end:

https://plnkr.co/edit/U1m7lWbE1kiBHlA5c9px?p=preview (reverse true)

https://plnkr.co/edit/4FAwUvSxlM3eo7n1MfIZ?p=preview (reverse false)

Please make sure to bind it using the property binding syntax, e.g. [reverse]="true".

The crossing values for the Y axis can be set via the axisCrossingValue property, but must be non-negative numbers, as there are no valid numbers that can represent a power to which the number is raised, such that the result would be negative.

We will consider updating the documentation to make the specifics of the logarithmic axis more clear.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Dinko
Top achievements
Rank 1
answered on 29 Mar 2018, 01:07 PM

Hi Dimiter,

Thanks for the explanation of the logic behind the axisCrossingValue.

What about the issue of the broken axis values? They do not match the data points.

By "reverse='true' does nothing to the axis" I meant that the data points are reversed to match the already reversed axis. The same axis is drawn with and without reverse.

How should we setup the chart so that small values are on the left and big one are on the right and the axis is logarithmic?

0
Accepted
Dimiter Topalov
Telerik team
answered on 30 Mar 2018, 11:48 AM
Hi Dinko,

Thank you for describing the problem further. Indeed, currently there is a discrepancy between setting "reverse" to false, and not setting it at all. This is a bug, and we will provide a solution in the next release of the Charts package. The erroneous behavior is observed only when setting the "reverse" value is omitted altogether:

https://plnkr.co/edit/Z0iN4TYP4bvJcWXK3f59?p=preview

Until the problem is resolved, you can explicitly set "reverse" to false to display values increasing from left to right (as previously suggested):

https://plnkr.co/edit/tVJxztrrzS974x8ci5fJ?p=preview

Setting "reverse" to true also behaves as expected (reversing both the values along the X axis and the position of the Y axis, essentially turning the graph around):

https://plnkr.co/edit/uJQ2v9MI5lzYw3DKuIaB?p=preview

I am sorry for all inconvenience caused, and I also updated your Telerik points for bringing this issue to our attention.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Dinko
Top achievements
Rank 1
answered on 30 Mar 2018, 12:02 PM
Thank you Dimiter. I will looks forward to the new release. In the mean time reverse=false fixes our case.
Tags
General Discussions
Asked by
Dinko
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Dinko
Top achievements
Rank 1
Share this question
or