문제

I have a line chart that sometimes contains a number of data points. I have solved how to prevent the horizontal axis from displaying too many labels using custom label functions and data functions. My problem is forcing the AxisRenderer not to scale down my labels.

I'm using the labelRotation property so the canDropLabels and canStagger properties are not an option.

Thanks in advance for any replies.

도움이 되었습니까?

해결책

Try use gutter, gutter set are for the axis labels (if you want u can try to read the code of the AxisRenderer, and see how it use the gutter and other parameters to scale if need the text.

You can set the gutter by style like this (this work for me):

LineChart {
     gutterLeft:50;
     gutterRight:50;
     gutterBottom:50;
}

다른 팁

I believe this can be done by editing the labelRenderer property. Take a look at the second example on this page (Formatting charts), they define a custom component to use as the label. You can do something like that to maintain whatever look you want.

I ran into the same issue. In my case (for the data that I'm plotting), simply setting canDropLabels to true (either in ActionScript or MXML as below) resulted in widening the margins allocated (I'm guessing) to the label text in the chart such that I never saw the text render smaller than set by fontSize below. Try it, it may be all you need.

hAxisRenderer.setStyle("canDropLabels",true); 
...
<mx:AxisRenderer id="hAxisRenderer" placement="bottom"
tickPlacement="inside" tickLength="8" 
canStagger="false" canDropLabels="false" fontSize="12">

For reference: http://blog.flexexamples.com/2007/10/16/dropping-labels-in-a-flex-chart/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top