# ZK Charts - y labels problem

AleAle
1

Hi! I have a bar chart and when the number of series is greater than (say) 20, the labels in the y series shows intercalated (one yes and one no). How can I set the font size of the y labels? How to avoid this problem?

PD: I have the commercial version

delete retag edit

Sort by » oldest newest most voted

jimmyshiau
4921 5
http://www.zkoss.org/

AleAle
1

Hi.

I solve part of the problem changing the style of the axis labels.

xAxis.getLabels().setStyle()

But that's not solve the issue when the labels are too long. I would like to use the formatter option of highcharts that allows to set a function to cut the labels for the axis but not for the tooltip. See: (api.highcharts.com/highcharts#plotOptions.bar.dataLabels.formatter)

Is there another option?

AleAle
1

Thank's for the reponse. I can't post an image because of zk forum policy.

Well, for now i'll truncate the labels.

hawk
2295 1 5
http://hawkphoenix.blogsp...

Hi,

could you post a picture that shows the long label issue? I see that when zkcharts will enlarge label area width of vertical axis:

By the way, because bar chart renders its YAxis horizontally, when you describe your issue, you had better use the terms "horizontal" and "vertical" instead of "x axis" and "y axis" to avoid ambiguity.

there is a xAxis.getLabels().setFormat("formatString"), but it seems highcharts format string only has options for date and number, not for string. http://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting

Currently you have to pre-process a axis label before you insert into model, e.g. truncate long label to 10 characters.

AleAle
1

I solved this by truncating long labels. I also have another problem regarding with this. When the height of the chart is of certain value, the labels in the axis are showed interloped. So I see one and one not. I decreased the size of the font, but still happends. I don't know how to handle this. Any ideas?

(the forum don't let me to upload files)

Thank's

[hide preview]