Hi Alex, Both axes work fine with the solution you provided. However, there is another issue I am facing right now. I'm displaying the counts on top of columnseries(using labelPosition = outside) and this label isn't picking up the embedded font. I tried assigning labelClass to column series, but this isn't working. Any ideas ?
http://pasteboard.co/27DN8kdC.png Code: .columnSeriesStyle { labelClass: ClassReference("mx.controls.Label");/*tried with and without labelClass*/ labelPosition:outside; fontSize: 14; fontFamily: myTahoma; fontWeight: normal; color:#3D3D3D; } <mx:ColumnSeries showDataEffect="slideUp" hideDataEffect="slideDown" xField="Company" styleName="columnSeriesStyle" yField="TrialCnt" displayName="Count" > On Sat, Jul 18, 2015 at 1:21 PM, Deepak MS <[email protected]> wrote: > That worked great. Thanks Alex. > I have filed it here: https://issues.apache.org/jira/browse/FLEX-34909 > > > On Fri, Jul 17, 2015 at 10:37 PM, Alex Harui <[email protected]> wrote: > >> Hmm. >> >> I would say there is a bug in Charts when working with embedded fonts. >> Please file a bug with your test case at >> https://issues.apache.org/jira/browse/FLEX. It appears that Charts tries >> to use Spark Label for the axis, but is still using UITextFields to >> measure labels. >> >> I think I got it to work by forcing Axis to use MX Labels. See below. >> >> HTH, >> -Alex >> >> <?xml version="1.0" encoding="utf-8"?> >> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" >> xmlns:s="library://ns.adobe.com/flex/spark" >> xmlns:mx="library://ns.adobe.com/flex/mx" >> minWidth="955" >> minHeight="600"> >> >> <fx:Style> >> @namespace s "library://ns.adobe.com/flex/spark"; >> @namespace mx "library://ns.adobe.com/flex/mx"; >> >> @font-face >> { >> src: url("assets/fonts/TAHOMA.TTF"); /* tried all >> fonts in the assets >> folder, they all are normal fonts(non bold or non italic) */ >> fontFamily: myFont; >> fontStyle: normal; >> fontWeight: normal; >> embedAsCFF: false; >> advancedAntiAliasing: true; >> } >> >> .chartFonts >> { >> fontFamily: myFont; >> fontWeight: normal; >> fontSize: 26; >> } >> >> .axisStyles >> { >> labelClass: ClassReference("mx.controls.Label"); >> } >> >> </fx:Style> >> >> <fx:Script> >> <![CDATA[ >> import mx.collections.ArrayCollection; >> [Bindable] >> private var medalsAC:ArrayCollection = new >> ArrayCollection( [ >> { Country: "USA", Gold: 35, Silver:39, >> Bronze: 29 }, >> { Country: "China", Gold: 32, Silver:17, >> Bronze: 14 }, >> { Country: "Russia", Gold: 27, Silver:27, >> Bronze: 38 } ]); >> ]]> >> </fx:Script> >> <mx:ColumnChart id="column" styleName="chartFonts" >> height="100%" showDataTips="true" >> width="50%" >> dataProvider="{medalsAC}" >> seriesFilters="{[]}" >> > >> <mx:horizontalAxis> >> <mx:CategoryAxis id="ca" categoryField="Country"/> >> </mx:horizontalAxis> >> <mx:horizontalAxisRenderers> >> <mx:AxisRenderer axis="{ca}" styleName="axisStyles"/> >> </mx:horizontalAxisRenderers> >> <mx:verticalAxis> >> <mx:LinearAxis id="la" /> >> </mx:verticalAxis> >> <mx:verticalAxisRenderers> >> <mx:AxisRenderer axis="{la}" styleName="axisStyles"/> >> >> </mx:verticalAxisRenderers> >> <mx:series> >> <mx:ColumnSeries >> xField="Country" >> yField="Gold" >> >> displayName="Gold" >> > >> >> </mx:ColumnSeries> >> >> </mx:series> >> </mx:ColumnChart> >> </s:Application> >> >> >> >> >> On 7/16/15, 11:34 PM, "megharajdeepak" <[email protected]> wrote: >> >> >SampleChart.zip >> >< >> http://apache-flex-users.2333346.n4.nabble.com/file/n10800/SampleChart.zi >> >p> >> > >> >I'm using Flex 4.14 AIR 16, FP 16. >> > >> >I have attached sample fxp project with all the fonts as well. >> > >> > >> > >> >-- >> >View this message in context: >> > >> http://apache-flex-users.2333346.n4.nabble.com/Embedded-font-for-Charts-tp >> >10793p10800.html >> >Sent from the Apache Flex Users mailing list archive at Nabble.com. >> >> >
