1 Reply Latest reply on May 24, 2011 4:51 AM by Tanu Jain

    currency labelfunction for y axis

    BosDog Level 1

      in Flex 3 how would i get the y axis formatted to have commas in the numbers? see my chart below:

      graph3.jpg

       

      also is it possible to format the toolTips that show when you hover over the items in the chart as well (like in the below screenshot)?

       

      graph2.jpg

       

      Some sample code would be nice. All these charts in Flex are wonderful... but I consistently hear from users they want commas in their numbers! i don't blame them!

       

      Here is my sample code for these charts:

       

      <mx:VBox horizontalAlign="center" width="100%" height="100%" id="b2">
                  <mx:Label text="Total Pay Breakdown" fontWeight="bold"/>       
                  <mx:ColumnChart id="multiChart" width="100%" height="100%" dataProvider="{parentApplication.Service.getPaymentSummary.lastResult}" showDataTips="true">
                      <mx:horizontalAxis>
                         <mx:CategoryAxis
                              dataProvider="{parentApplication.Service.getPaymentSummary.lastResult}"
                              categoryField="PERIOD_NAME"
                         />
                      </mx:horizontalAxis>

       

                      <mx:verticalAxisRenderers>
                          <mx:AxisRenderer placement="left" axis="{v1}"/>
                          <mx:AxisRenderer placement="right" axis="{v2}"/>
                      </mx:verticalAxisRenderers>

       

                      <mx:series>
                         <mx:ColumnSeries
                              xField="PERIOD_NAME"
                              yField="REP_COMMISSION_PAID"
                              displayName="Payment">
                              <mx:verticalAxis>
                                  <mx:LinearAxis title="Payment" id="v1"/>
                              </mx:verticalAxis>          
                         </mx:ColumnSeries>               

       

                         <mx:LineSeries
                              xField="PERIOD_NAME"
                              yField="CUM_PAY"
                              displayName="Cumulative Payment">
                              <mx:verticalAxis>
                                  <mx:LinearAxis title="Cumulative Payment" id="v2"/>
                              </mx:verticalAxis>                    
                         </mx:LineSeries>
                        
                      </mx:series>
                   </mx:ColumnChart>
                   </mx:VBox>