FusionCharts Forum: xml builder and Styles - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

xml builder and Styles How to set stykes with xml builder

#1 User is offline   mole1066 

  • Forum Newbie
  • Group: Members
  • Posts: 5
  • Joined: 21-February 09

Posted 27 February 2009 - 03:51 AM

I am trying to style my charts and am having issues getting the xml databuilder to change the chart. I have added the following simple example. Although it seems to build correctly i do not see any changes in the chart. Any clues?


xml = Builder::XmlMarkup.new

xml.chart(:caption=>'Problems by category', :numberPrefix=>'£', :formatNumberScale=>'0') do

  for item in arr_data

    xml.set(:label=>item[0], :value=>item[1])

  end



  xml.styles()do

    xml.defintion() do

      xml.style(:name=>'Mystyle', :type=>'font', :Color=>'FF3333')

    end

    xml.application()do

      xml.apply(:toObject=>'Canvas', :styles=>'Mystyle')

    end

  end

end





Michael
Michael
0

Other Replies To This Topic

#2 User is offline   srividya_sharma 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 943
  • Joined: 01-October 07

Posted 27 February 2009 - 07:33 PM

Hi Michael

1. There is a typo in <definition>, xml.defintion() should be xml.definition()

2. You have not applied the Font to the right object.

Please see http://www.fusioncharts.com/Docs/Contents/Styles/HowToUse.html, scroll down and see a table for each Object what are the Features Supported.

The Canvas object does not support the Font style.

What is it that you want to achieve? If you want to set the Font color for all text in the canvas, you can use the chart attribute baseFontColor. This attribute sets the base font color of the chart i.e., all the values and the names in the chart which lie on the canvas will be displayed using this font color.

If you want to try styles, then apply this style to Caption and see.

Hope this helps.

Srividya

regards,
Srividya Sharma
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic