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     [SOLVED] need to update dataGrid in FLEX/ibiChartDataView

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] need to update dataGrid in FLEX/ibiChartDataView
 Login/Join
 
Gold member
posted
I need to somehow get the data grid in the ibiChartDataView to update. Two things need to happen, I need the amount column to update when I change the xField in my graph, and second, I need to be able to customize the column titles in the dataGrid as well so that they are user friendly names rather than field names.

Here is an example of what I'm doing. When you change the measurement field via the combobox, the graph updates, but the dataGrid in the chart data view does not (grab the corner of the graph to turn the page).

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" xmlns:ibi="http://www.informationbuilders.com">
	<mx:Script>
		<![CDATA[
			import mx.events.ListEvent;
			private var myRequest:String = "TABLE FILE CAR SUM DEALER_COST RETAIL_COST SALES BY COUNTRY\nON TABLE PCHOLD FORMAT XML\nEND";
			[Bindable]
			protected var myUrl:String = "http://localhost/ibi_apps/WFServlet?IBIF_adhocfex=" + encodeURIComponent(myRequest);
			[Bindable]
			protected var fieldLabels:Array = new Array("Dealer Cost","Retail Cost","Sales");
			protected var fieldValues:Array = new Array("DEALER_COST","RETAIL_COST","SALES");
			
			protected function field_changeHandler(event:ListEvent):void
			{
				salesChart.series[0].xField = fieldValues[field.selectedIndex];
				salesChart.series[0].displayName = fieldLabels[field.selectedIndex];
			}
			
		]]>
	</mx:Script>
	
	<mx:SeriesInterpolate id="int" duration="800"/>
	
	<ibi:ibiCanvas x="10" y="10" width="1007" height="614">
		
		<mx:ComboBox id="field" x="283" y="10" dataProvider="{fieldLabels}" change="field_changeHandler(event)"></mx:ComboBox>
		<ibi:ibiDataGrid id="salesData" ibiUseColumns="COUNTRY,DEALER_COST,RETAIL_COST,SALES" seturl="{myUrl}" visible="false"/>
		
		<ibi:ibiChartDataView id="salesBook" height="300" width="400" activeGrabArea="corners" edgeAndCornerSize="20" y="57">
			<ibi:ibiChart>
				<ibi:ibiBarChart id="salesChart" x="61" y="79" width="300" height="400" ibiParent="salesData"
								 ibiXField="DEALER_COST" ibiYField="COUNTRY" showDataTips="true">
					<ibi:verticalAxis>
						<mx:CategoryAxis id="ps2axis" categoryField="COUNTRY"/>
					</ibi:verticalAxis>
					<ibi:series>
						<mx:BarSeries xField="DEALER_COST" displayName="Dealer Cost" showDataEffect="int">
							<mx:fill>
								<mx:LinearGradient angle="90">
									<mx:GradientEntry alpha="1" color="#8A0000" ratio="0" />
									<mx:GradientEntry alpha="1" color="#EA0000" ratio=".3" />
									<mx:GradientEntry alpha="1" color="#500000" ratio="1" />
								</mx:LinearGradient>
							</mx:fill>
						</mx:BarSeries>
					</ibi:series>		
				</ibi:ibiBarChart>
			</ibi:ibiChart></ibi:ibiChartDataView>
		
	</ibi:ibiCanvas>
	
</mx:Application>

This message has been edited. Last edited by: Gizmo,



Windows: WF 7.6.2: SQL Server 2008 R2
 
Posts: 86 | Location: Chicago | Registered: August 03, 2007Report This Post
Gold member
posted Hide Post
I've finally figured out the script to resolve the issue (field_changeHandler function). I'm not sure that this is the best way of doing this, but at least it works.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" xmlns:ibi="http://www.informationbuilders.com">
	<mx:Script>
		<![CDATA[
			import mx.controls.Alert;
			import mx.events.ListEvent;
			private var myRequest:String = "TABLE FILE CAR SUM DEALER_COST RETAIL_COST SALES BY COUNTRY\nON TABLE PCHOLD FORMAT XML\nEND";
			[Bindable]
			protected var myUrl:String = "http://localhost/ibi_apps/WFServlet?IBIF_adhocfex=" + encodeURIComponent(myRequest);
			[Bindable]
			protected var fieldLabels:Array = new Array("Dealer Cost","Retail Cost","Sales");
			protected var fieldValues:Array = new Array("DEALER_COST","RETAIL_COST","SALES");
			
			protected function field_changeHandler(event:ListEvent):void
			{
				salesChart.series[0].xField = fieldValues[field.selectedIndex];  // set chart data field name
				salesChart.series[0].displayName = fieldLabels[field.selectedIndex];  // set chart data label
				salesBook.content[1].columns[1].dataField = fieldValues[field.selectedIndex]; //set data grid field name
				salesBook.content[1].columns[1].headerText = fieldLabels[field.selectedIndex];  // set datagrid column title
			}
			
		]]>
	</mx:Script>
	
	<mx:SeriesInterpolate id="int" duration="800"/>
	
	<ibi:ibiCanvas id="dashboard" x="10" y="10" width="1007" height="614">
		
		<mx:ComboBox id="field" x="283" y="10" dataProvider="{fieldLabels}" change="field_changeHandler(event)"></mx:ComboBox>
		<ibi:ibiDataGrid id="salesData" ibiUseColumns="COUNTRY,DEALER_COST,RETAIL_COST,SALES" seturl="{myUrl}" visible="false"/>
		
		<ibi:ibiChartDataView id="salesBook" height="300" width="400" activeGrabArea="corners" edgeAndCornerSize="20" y="57">
			<ibi:ibiChart>
				<ibi:ibiBarChart id="salesChart" x="61" y="79" width="300" height="400" ibiParent="salesData"
								 ibiXField="DEALER_COST" ibiYField="COUNTRY" showDataTips="true">
					<ibi:verticalAxis>
						<mx:CategoryAxis id="ps2axis" categoryField="COUNTRY"/>
					</ibi:verticalAxis>
					<ibi:series>
						<mx:BarSeries xField="DEALER_COST" displayName="Dealer Cost" showDataEffect="int">
							<mx:fill>
								<mx:LinearGradient angle="90">
									<mx:GradientEntry alpha="1" color="#8A0000" ratio="0" />
									<mx:GradientEntry alpha="1" color="#EA0000" ratio=".3" />
									<mx:GradientEntry alpha="1" color="#500000" ratio="1" />
								</mx:LinearGradient>
							</mx:fill>
						</mx:BarSeries>
					</ibi:series>		
				</ibi:ibiBarChart>
			</ibi:ibiChart></ibi:ibiChartDataView>
		
	</ibi:ibiCanvas>
	
</mx:Application>




Windows: WF 7.6.2: SQL Server 2008 R2
 
Posts: 86 | Location: Chicago | Registered: August 03, 2007Report This Post
<FreSte>
posted
Gizmo,

Thanks for posting the solution. I have been trying to figure this out for hours, but withoput any luck.
Never thought you have to approach this via id=salesbook (I tried almost everything via id=saleschart).

So, thanks again

-Fred-
 
Report 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     [SOLVED] need to update dataGrid in FLEX/ibiChartDataView

Copyright © 1996-2020 Information Builders