Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Creating Barchart by using ibiDatagrid in Action sctipt

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Creating Barchart by using ibiDatagrid in Action sctipt
 Login/Join
 
Gold member
posted
Hi All,
I have the below code it reads the data from Arraycollection. But i want to create graph from datagrid and grid is loading the data from fex file. Any suggestions please. Below is the mxml reference code. Thanks!

 <?xml version="1.0"?>
<!-- charts/CreateChartInActionScript.mxml -->
<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:mx="library://ns.adobe.com/flex/mx" 
    xmlns:s="library://ns.adobe.com/flex/spark"
    creationComplete="init()"
    height="600">

    <s:layout>
        <s:VerticalLayout/>
    </s:layout>
    
  <fx:Script><![CDATA[
     import mx.collections.ArrayCollection;
     import mx.charts.BarChart;
     import mx.charts.series.BarSeries;
     import mx.charts.CategoryAxis;
     import mx.charts.Legend;

     [Bindable]
     public var expenses:ArrayCollection = new ArrayCollection([
        {Month:"Jan", Profit:2000, Expenses:1500},
        {Month:"Feb", Profit:1000, Expenses:200},
        {Month:"Mar", Profit:1500, Expenses:500}
     ]);

     public var myChart:BarChart;
     public var series1:BarSeries;
     public var series2:BarSeries;
     public var legend1:Legend;

     public function init():void {
        /* Create the chart object and set some 
           basic properties. */
        myChart = new BarChart();
        myChart.showDataTips = true;
        myChart.dataProvider = expenses;

        /* Define the category axis. */
        var vAxis:CategoryAxis = new CategoryAxis();
        vAxis.categoryField = "Month" ;
        vAxis.dataProvider =  expenses;
        myChart.verticalAxis = vAxis;

        /* Add the series. */
        var mySeries:Array=new Array();
        series1 = new BarSeries();
        series1.xField="Profit";
        series1.yField="Month";
        series1.displayName = "Profit";
        mySeries.push(series1);

        series2 = new BarSeries();
        series2.xField="Expenses";
        series2.yField="Month";
        series2.displayName = "Expenses";
        mySeries.push(series2);

        myChart.series = mySeries;

        /* Create a legend. */
        legend1 = new Legend();
        legend1.dataProvider = myChart;

        /* Attach chart and legend to the display list. */
        p1.addElement(myChart);
        p1.addElement(legend1);
     }
  ]]></fx:Script>

  <s:Panel id="p1" title="BarChart Created in ActionScript">
    <s:layout>
        <s:VerticalLayout/>
    </s:layout>  
  </s:Panel>
</s:Application> 


WebFOCUS 8104/7703/769/764, Windows 7, Oracle 11g, DB2, QAD
 
Posts: 49 | Location: Chennai | Registered: May 20, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Creating Barchart by using ibiDatagrid in Action sctipt

Copyright © 1996-2020 Information Builders