Forum > TAChart

[SOLVED] Bottom axis disappears

<< < (2/2)

artem101:

--- Quote from: artem101 on July 29, 2022, 03:18:48 pm ---if choosed interval very big many labels overlaps each other. Is it possible to autohide some of them

--- End quote ---

I found solution:

--- Code: Pascal  [+][-]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";}};} ---Marks.OverlapPolicy = opHideNeighbour
And my problem completely solved.

wp:
I don't like the opHideNeighbour option because it very easily can result in irregularly spaced labels which may be confusing to the user. In this particular case in which you only want year labels I would use two chart sources and check in the OnExtentChanged and OnResize events which steps the DateTimeInterval will be using. If it is dtsYear I'd label the x axis by means of the DateTimeIntervalChartSource which is constructed to consider overlapping labels automatically. If the steps are different from dtsYear I'd use the ListChartSource which is populated to contain only the year values and omits the intermediate labels in dtsMonth mode, for example.

Please have a look at the attached demo.

Navigation

[0] Message Index

[*] Previous page

Go to full version