You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Deepak MS <me...@gmail.com> on 2015/09/30 14:03:36 UTC
Chart AxisRenderer's labelRotation not working
Hello,
I'm using Cartesian chart and adding columseries or lineseries dynamically
based on data to it.
In flex 3.6, x axis labels were rendered(rotated) according to space
available and size of the label like this:
http://pasteboard.co/11CRmior.png
http://pasteboard.co/11CU4Uej.png
But in flex 4.14.1, labels are not getting rotated. I tried to explicitly
set labelRotation value of the X axis' AxisRenderer, but nothing happens.
It always looks like this:
http://pasteboard.co/11CIJWNC.png (in this example, label gets truncated -
last item is Sodium Chloride. But 'Chloride' is cut off)
http://pasteboard.co/11CLuFNk.png (in this one, months are not rotated like
how they used to in flex 3.6)
Is this an issue Or am I missing any property to be set in 4.14.1?
Re: Chart AxisRenderer's labelRotation not working
Posted by Deepak MS <me...@gmail.com>.
Yes I did try that. But this time around I did not wanted to embed any
font. Hence I just used labelClass and assigned MX label to it. But it
still did not work(rotation of labels). After trying out few things for a
while I realised, for this piece to work, I had to mandatorily embed a
font(with embedAsCFF = false) like before to the chart.
That fixed label rotation problem but now my X Axis' title is getting
disappeared.(in my case it is vAxisProdSales' title)
Here's sample code:
@font-face
{
src: url("fonts/Tahoma.ttf");
fontFamily: ChartFont;
fontStyle: normal;
fontWeight: normal;
embedAsCFF: false;
advancedAntiAliasing: true;
}
.axisStyle
{
labelClass: ClassReference("mx.controls.Label");
}
.chartStyle
{
labelClass: ClassReference("mx.controls.Label");
fontFamily: ChartFont;
fontWeight: normal;
fontSize: 12;
}
<mx:LinearAxis id="vAxisProdSales"
title="{mcbDisplayMetric.selectedItem.DisplayMetric}"
labelFunction="{numberFormatAxis(mcbDisplayMetric)}"/>
<mx:LinearAxis id="vAxisProdGrowth" title="Growth%"
labelFunction="percentageFormatAxis"/>
<mx:CartesianChart id="ccProd" width="100%" height="100%"
seriesFilters="{[]}"
showDataTips="true"
dataTipFunction="ccTip" styleName="chartStyle"
>
<mx:verticalAxisRenderers>
<mx:AxisRenderer placement="left"
axis="{vAxisProdSales}" verticalAxisTitleAlignment="vertical"
axisStroke="{new
SolidColorStroke(0x4a4a4a,1,0)}" styleName="axisStyle"
tickStroke="{new
SolidColorStroke(0x4a4a4a,1,0)}" minorTickStroke="{new
SolidColorStroke(0x4a4a4a,1,0)}"/>
<mx:AxisRenderer id="arProdGrowth"
placement="right" axis="{vAxisProdGrowth}"
axisStroke="{new
SolidColorStroke(0x4a4a4a,1,0)}" styleName="axisStyle"
tickStroke="{new
SolidColorStroke(0x4a4a4a,1,0)}" minorTickStroke="{new
SolidColorStroke(0x4a4a4a,1,0)}"/>
</mx:verticalAxisRenderers>
<mx:CategoryAxis id="ca"/>
<mx:horizontalAxisRenderers>
<mx:AxisRenderer id="arProd" axis="{ca}"
styleName="axisStyle"
axisStroke="{new
SolidColorStroke(0x4a4a4a,1,0)}"
placement="bottom"
minorTickPlacement="inside"
minorTickLength="2"
tickLength="5"
tickPlacement="inside"
tickStroke="{new SolidColorStroke(0x4a4a4a,1,0)}"
minorTickStroke="{new
SolidColorStroke(0x4a4a4a,1,0)}">
</mx:AxisRenderer>
</mx:horizontalAxisRenderers>
</mx:CartesianChart>
On Wed, Sep 30, 2015 at 9:31 PM, Alex Harui <ah...@adobe.com> wrote:
> Did you apply the workaround to use MX Label or TextFields in the chart?
>
> -Alex
>
> On 9/30/15, 5:03 AM, "Deepak MS" <me...@gmail.com> wrote:
>
> >Hello,
> >I'm using Cartesian chart and adding columseries or lineseries dynamically
> >based on data to it.
> >
> >In flex 3.6, x axis labels were rendered(rotated) according to space
> >available and size of the label like this:
> >http://pasteboard.co/11CRmior.png
> >http://pasteboard.co/11CU4Uej.png
> >
> >But in flex 4.14.1, labels are not getting rotated. I tried to explicitly
> >set labelRotation value of the X axis' AxisRenderer, but nothing happens.
> >It always looks like this:
> >http://pasteboard.co/11CIJWNC.png (in this example, label gets truncated
> -
> >last item is Sodium Chloride. But 'Chloride' is cut off)
> >
> >http://pasteboard.co/11CLuFNk.png (in this one, months are not rotated
> >like
> >how they used to in flex 3.6)
> >
> >Is this an issue Or am I missing any property to be set in 4.14.1?
>
>
Re: Chart AxisRenderer's labelRotation not working
Posted by Alex Harui <ah...@adobe.com>.
Did you apply the workaround to use MX Label or TextFields in the chart?
-Alex
On 9/30/15, 5:03 AM, "Deepak MS" <me...@gmail.com> wrote:
>Hello,
>I'm using Cartesian chart and adding columseries or lineseries dynamically
>based on data to it.
>
>In flex 3.6, x axis labels were rendered(rotated) according to space
>available and size of the label like this:
>http://pasteboard.co/11CRmior.png
>http://pasteboard.co/11CU4Uej.png
>
>But in flex 4.14.1, labels are not getting rotated. I tried to explicitly
>set labelRotation value of the X axis' AxisRenderer, but nothing happens.
>It always looks like this:
>http://pasteboard.co/11CIJWNC.png (in this example, label gets truncated -
>last item is Sodium Chloride. But 'Chloride' is cut off)
>
>http://pasteboard.co/11CLuFNk.png (in this one, months are not rotated
>like
>how they used to in flex 3.6)
>
>Is this an issue Or am I missing any property to be set in 4.14.1?