Forum > TAChart

TAChart - Logarithmic Scaling - crash


Attached is a Demo of WP, which I recommend to everybody.
It paints piled bars.

Unfortunately I managed to damage it.
I read

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---[Window Title]Fehler [Content]Projekt project1 hat Exception-Klasse »External: FLT OVERFLOW« ausgelöst.  Bei Adresse 10000587C [Ok]
after having done this:

- add a "Chart Axes Transformation"
- set it to "logarithmic" and watch the chart-scaling changing at design-time
- start the app (chart drawing is at runtime in the create-event)
- read the above error-message

Is this my fault or is there another problem?

Your steps to reproduce are missing one important part:

Set the AxisIndexY property of the series to the index of the y axis (usually 0). This links the series to the transformation and causes calculation of the logs of the (stacked) y values.

Your error message reports a numerical overflow because the chart calculates the expression 10^(datavalue) in order to find good axis labels. But without the linked AxisIndexY the series does not know about the log transform and passes its values directly, e.g. 521 for the first y value of the first data point, and 10^521 cannot be calculated for the double precision data type. But on the other hand, when AxisIndexY is assigned correctly the series can use the transformation to calculate the log and passes these values (2...3 for 100 to 1000) to the axis labeling routine.

Read this, in other words, also in,_Logarithmic_Axis,_Fitting#Setting_up_a_logarithmic_axis

thank you so much!


[0] Message Index

Go to full version