0
votes

I am using a column chart which has a horizontal axis for displaying dates.

Problem is when there are large data points then it shrinks the size of the label for the x-axis and i don't want this to happen.

I am displaying dates in batches but still the label don't occupy the available space. The size of the label shrinks and the text is hardly readable.

Any suggestion on how i could increase the label size irrespective of the number of ticks.

Here is a snippet of my code.

Thank You.

  <mx:ColumnChart id = "areaChart"
                  height = "100%" 
                  width = "100%" 
                  seriesFilters="[]"                    
                  showDataTips="false"
                  type="overlaid"
                  columnWidthRatio="0.40"
                  mouseMove="showData(event)"
                  mouseSensitivity="600"
                  change="{callLater(showDefaultData)}"> 

       <mx:horizontalAxis>
            <mx:CategoryAxis categoryField = "date"
                             id = "hax"         
                             ticksBetweenLabels="true"
                             labelFunction="chartsLabel"/>
        </mx:horizontalAxis>

        <mx:horizontalAxisRenderers>
            <mx:AxisRenderer id="har" 
                             axis="{hax}"
                             textAlign="left"
                             tickPlacement="none"   
                             placement="bottom"                                                  
                             axisStroke="{Stroke}"/>


        </mx:horizontalAxisRenderers>
3

3 Answers

0
votes

Define a style for the AxisRenderer and use it in your definition:

Style:

<mx:Style>
    .axisStyle {
        fontSize:10;
        color:blue;
    }
</mx:Style>

Usage:

    <mx:horizontalAxisRenderers>
       <mx:AxisRenderer axis="{axisName}" styleName="axisStyle"/>
    </mx:horizontalAxisRenderers>

    <mx:horizontalAxis>
       <mx:CategoryAxis id="axisName" dataProvider="{dataProvider}" 
            categoryField="someCategory"/>
    </mx:horizontalAxis>
0
votes

You shall set

canDropLabels="true|false"

canStagger="true|false"

styles for chart's axisrenderer: it shall know what to do if there are too much text.

You can also set scaleX and scaleY properties for axisrenderer if you want to force removal of scaling. But you'll not need it unless you do something tricky.

You can also set gutters for chart and axisrenderer to provide extra space for drawing labels, but again, normally you will not need it.

0
votes

Unfortunately, teh CategoryAxis doesn't seem to have a renderer and therefore canDropLabels and canStagger cannot be set for it.