Guest Basundhara Ghosal

Font Styles not working properly!

Recommended Posts

I am using the following to define my base font:

baseFont='comic sans ms'

baseFontSize ='14'

baseFontColor ='000000'

As i want to be able to use different font types in my document, I use styles to do this:

 

<style name='Labels' type='font' face='Verdana' size='12' color='000000' bold='0'/>

<style name='Title' type='font' face='Arial' size='26' color='000000' bold='0'/>

<apply toObject='DATALABELS' styles='Labels' />

<apply toObject='Caption' styles='Title' />

 

Now the odd thing I find is that the base font type is applied to ALL my fonts (comic Sans MS) while the style font types are not, so that Verdana and Arial are ignored, yet the font sizes found in my styles, are applied!

Anyone?

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Jimmi,

 

 

 

The baseFont attribute lets you set the font face (family) of all the text (data labels, values etc.) on chart. So when you are using this attribute automatically all the fonts in your chart gets effected.

 

 

 

Could you please try using the attribute 'outCnvBaseFont' in the chart element to use your own 'styles'.

 

 

 

Ref:-http://www.fusioncharts.com/docs/Contents/AttDesc/FontProperties.html

 

 

 

Hope this helps.:)

Share this post


Link to post
Share on other sites

Thank you for the quick reply :)

I've looked at the link, as well as tried using the outCnvBaseFont and related properties, but I am still unable to use different fonts in the same Graph!

The only differences I can make are in font size and color - the font type (arial, calibri, comic sans, verdana or whatever) remains the same!

I've tried removing any references to fonts in the graph and only put them in the styles part, but that still didn't work . . .

Anyways, here's the XML:

<code>

<graph caption='Magandang Babae Call Center'

subCaption='Service Activity Capacity: Resources vs. Used - past 2 weeks'

xAxisName='Week Days'

yAxisName='Man Hours'

numbersuffix=''

showValues='0'

decimals='0'

formatNumberScale='0'

plotGradientColor=''

bgColor='1b6903'

bgAlpha='50'

canvasBgColor='DDDDDD'

canvasBgAlpha='80'

baseFont='Arial'

baseFontSize ='12'

baseFontColor ='000000'

outCnvBaseFont='Comic Sans MS'

outCnvBaseFontSize='14'

outCnvBaseFontColor='ff0000'

labelDisplay='Rotate'

plotBorderDashed='1'>

<categories>

  <category label='Monday 18th September' />

  <category label='Tuesday 19th September' />

  <category label='Wednesday 20th September' />

  <category label='Thursday 21st September' />

  <category label='Friday 22nd September' />

  <category label='Saturday 23rd September' />

  <category label='Monday 24th September' />

  <category label='Tuesday 25th September' />

  <category label='Wednesday 26th September' />

  <category label='Thursday 27th September' />

  <category label='Friday 28th September' />

  <category label='Saturday 29th September' />

</categories>

<dataset seriesName='Available Resources' color='00cc00'>

  <set value='279' />

  <set value='295' />

  <set value='267' />

  <set value='266' />

  <set value='302' />

  <set value='329' />

  <set value='311' />

  <set value='344' />

  <set value='315' />

  <set value='321' />

  <set value='343' />

  <set value='299' />

</dataset>

<dataset seriesName='Used Resources' color='ff0000'>

  <set value='244' />

  <set value='268' />

  <set value='258' />

  <set value='268' />

  <set value='266' />

  <set value='286' />

  <set value='281' />

  <set value='267' />

  <set value='257' />

  <set value='260' />

  <set value='248' />

  <set value='256' />

</dataset>

<styles>

<definition>

 <style name='Labels' type='font' face='Verdana' size='12' color='000000' bold='0'/>

 <style name='Title' type='font' face='Times New Roman' size='26' color='000000' bold='0'/>

</definition>

<application>

 <apply toObject='DATALABELS' styles='Labels' />

 <apply toObject='Caption' styles='Title' />

</application>

 </styles>

</graph>

<code>

Share this post


Link to post
Share on other sites
Guest Madhumita

Hello Jimmi,

The STYLES feature is not a part of FusionCharts Free version. That is why you are getting mixed results.

The STYLES feature is a part of FusionCharts v3.

 

We have run your XML in FusionCharts v3 and with some minor changes we have resolved the issue.

If you do not use outCnvBaseFont='Comic Sans MS' , outCnvBaseFontSize='14' , outCnvBaseFontColor='ff0000'  in your chart element you will be able to display different fonts for the objects specified, when using the STYLES feature.

 

Please refer to the image attached.

 

Could you please consider downloaing FusionCharts Trial Package from the following link:

http://www.fusioncharts.com/download.asp

FusionCharts Trial is a no-restriction evaluation of the actual component i.e., there are no days and feature limitations in this trial. The only difference is that in the trial version charts, "FusionCharts" and "InfoSoft Global" imprints would be present on the charts. Once you purchase a license, these imprints would be automatically removed.

 

Hope this helps. :)

font.zip

Edited by Guest

Share this post


Link to post
Share on other sites

Again, thank you for the quick answer . . .

 

Actually, we are using the licensed and full version! I did start out with the trial version, to test and learn the product, but even before that, my company had obtained a license and I am working with the licensed version now!

However, I use FusionCharts through java pages in CRM Alive (www.CRMAlive.com). I'm not sure whether this makes a difference, but from I understand, it shouldn't.

 

I've found a simpler example (normal 2d column chart):

  <Code>

<graph bgColor='1c404c,FFFFFF'

subCaption='Monthly Revenues in US$'

xAxisName='Month'

yAxisName='Revenue'

numbersuffix='$'

showValues='0'

decimals='0'

formatNumberScale='0'

plotGradientColor=''

caption='Joint Software Engineers - Revenue Chart 2008'

bgAlpha='50'

canvasBgColor='DDDDDD, bfd0d7'

canvasBgAlpha='80'

baseFont='Times New Roman'

baseFontSize ='12'

baseFontColor ='000000'>";

 

  <set label='Jan' value='462000' color='68670d'/>

  <set label='Feb' value='857000' color='406e7b'/>

  <set label='Mar' value='671000' color='bfd0d7'/>

  <set label='Apr' value='494000' color='bbb96f'/>

  <set label='May' value='761000' color='1c404c'/>

  <set label='Jun' value='960000' color='e4e7b2'/>

  <set label='Jul' value='629000' color='68670d'/>

  <set label='Aug' value='922000' color='406e7b'/>

  <set label='Sep' value='376000' color='bfd0d7'/>

  <set label='Oct' value='394000' color='bbb96f'/>

  <set label='Nov' value='732000' color='1c404c'/>

  <set label='Dec' value='860000' color='e4e7b2'/>

 <styles>

<definition>

 <style name='Title' type='font' face='Arial' size='16' color='000000' bold='1'/>

</definition>

<application>

 <apply toObject='Caption' styles='Title' />

</application>

 </styles>  

</Code>

Please disregard the backslashes - necessary in my code...

Shouldn't the base font be "overwritten" by styles?

 

Edited by Guest

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Jimmi,

 

 

 

The 'styles' that you have applied on 'caption' is getting effected.

 

 

 

We have tested your XML in our lab and tried to make a sample using your XML code.

 

 

 

The sample is been send to you as an attachment. Please have a look.

 

 

 

Hope this helps.:)

Topic18599-28-1.zip

Share this post


Link to post
Share on other sites

Once more - thank you for the quick reply . . .

The issue seems to be with my browser somehow (I'm guessing) as the chart you've sent me renders everything in one font type as well - again, sizes, italic, bold and underline is rendered properly, but the font type remains the same!  I've tested in both Mozilla and IE and even on my colleaguse computer (IE) with the same result!

I've sent a screenshot to document this . . .

At first I thought it was an issue related to the way we use FusionCharts or the server that's running it, but this proves that it must be some setting or otherwise - do you have a clue?

post-6178-128441576008_thumb.png

Share this post


Link to post
Share on other sites
Guest Basundhara Ghosal

Hi Jimmi,

 

 

 

The 'styles' attribute can override the 'baseFont'/'outCnvBaseFont' attribute(s).

 

 

 

Try changing the following:-

 

 

 

<style name='Title' type='font' font='Arial' size='16' color='000000' bold='1'/>

 

 

 

We have send you a sample as attachment. Please have a look.

 

 

 

Hope this helps.:)

example.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now