In this section we will discuss the formatting of the Legend in the Chart control.
In this section we will discuss the formatting of the Legend in the Chart control.In this section we will discuss the formatting of the Legend in the Chart control. You can change the formatting of legend by using CSS and Action script. In this example we will use the CSS property for change the formatting of legend in the chart control.
|
<?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">} mx|LegendItem{} </fx:Style><![CDATA[ import mx.collections.ArrayCollection;[ Bindable] public var student:ArrayCollection = new ArrayCollection([{ "Stream":"Management", "Girls":1000, "r":10 },{ "Stream":"Computer Science", "Girls":800, "r":4 },{ "Stream":"Mechanical", "Girls":200, "r":6 },{ "Stream":"Electical", "Girls":800, "r":3 },{ "Stream":"Electronics", "Girls":500, "r":8 },{ "Stream":"Civil", "Girls":300, "r":7 }]); [ Bindable] public var student1:ArrayCollection = new ArrayCollection([{ "Stream":"Management", "Boys":1400, "r":7},{ "Stream":"Computer Science", "Boys":1200, "r":8},{ "Stream":"Mechanical", "Boys":1500, "r":2},{ "Stream":"Electical", "Boys":850, "r":5},{ "Stream":"Electronics", "Boys":1000, "r":10},{ "Stream":"Civil", "Boys":900, "r":1}]); [ Bindable] public var student2:ArrayCollection = new ArrayCollection([{ "Stream":"Management", "TotalStudent":2400, "r":3},{ "Stream":"Computer Science", "TotalStudent":2000, "r":7},{ "Stream":"Mechanical", "TotalStudent":1700, "r":4},{ "Stream":"Electical", "TotalStudent":1650, "r":10},{ "Stream":"Electronics", "TotalStudent":1500, "r":1},{ "Stream":"Civil", "TotalStudent":1200, "r":9}]); leg1.setStyle( "color", "#FFFFFF");} ]]> </fx:Script> <s:Panel title="Formatting Legend in Chart Example" width="521" height="520">minRadius=" 1"maxRadius=" 10"showDataTips=" true"paddingBottom=" 10"paddingLeft=" 10"paddingRight=" 10"paddingTop=" 10"width=" 515">dataProvider=" {student}"/>xField=" Girls"yField=" Stream"displayName=" Girls"fill=" {s1}"stroke=" {scs1}"dataProvider=" {student}"radiusField=" r"/> <mx:BubbleSeries id="as2"xField=" Boys"yField=" Stream"displayName=" Boys"fill=" {s2}"stroke=" {scs2}"dataProvider=" {student1}"radiusField=" r"/>xField=" TotalStudent"yField=" Stream"displayName=" TotalStudent"fill=" {s3}"stroke=" {scs3}"dataProvider=" {student2}"radiusField=" r"/> </mx:series>dataProvider=" {bubblechart1}"direction=" horizontal"height=" 41" cornerRadius="20"/></s:Application> |
To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.