Create and Load Chart dynamically in Flex
Hi Friends,
I want to create the chart dynamically [N numbers] . I try
to create one line chart and add line series by action script , but
i stuck up at how to embed that chart object in mxml code. I want
to load the [action script created ] chart in canvas container.
Plz help me if u have any ideas ,
thanks
ksam.
what i would like to have is like this...
XML Template :
<class name="TaskA" getters="true" setters="true">
<properties name="id" type="java.lang.Long" defaultValue="0"/>
<properties name="name" type="java.lang.String" defaultValue="null"/>
<properties name="priority" type="java.lang.Integer" defaultValue="3"/>
</class>
And using some java code i could generate a class at runtime, the prototype of which would be something like this...
public class TaskA {
java.lang.Long id=0;
java.lang.String=null;
java.lang.Integer priority=3;
..................... //Getters and Setters of the properties.
}
Similar Messages
-
How to create and save a file in flex web application ?
Hi,
I want to create and save a file form flex web application. Is it possible ?
I have done some googling and found that its only possible through file referece, which needs some serverside implementation be called.
Is it not possible with file reference to create and save file directly ?
Can any one suggest how to over come this.
Thanks in advance.Alex,
code written with the Flex Builder 3 libraries will certainly run in Flash Player 10. However, what you need is not so much the capabilities of FP10 but the library functionalities of the Flex 4 package. And I think that Flex 4 code will only run in FP10 and not 9 (but haven't tested this as at work we have not yet been permitted to upgrade, so there is not a lot of point going for Flex 4!).
Richard -
Creating and filling JTables dynamically
Hello,
How can I create and display a JTable dynamically in a Java application? In my application, I retrieve rows from a database and therefore I don't know in advance how many rows I need for my JTable (using the tablemodel). I tried to solve the problem in the following way:
1)start op applicatie with a JTable with 0 rows (screen is grey, only columns are visible)
2)run query and count number of rows.
3)create new JTable based on number retrieved in step 2 and tried to put it onto the screen.
4)run query again and fill table with values retrieved from query
The bottleneck so far is step 3. I can create a new table but I don't manage to put it onto the screen (i tried already the repaint() method)
Thanx for you help
FritsSure, no problem. Assume you've retrieved the following result from the database:First Name Last Name Age
John Doe 25
Jane Doe 27
Joe Smith 40
Mary Smith 19You create your JTable as like this:Vector headings = new Vector();
Vector rows = new Vector();
Vector cells = null;
JTable table = null;
for(int x=0; x< resultSize; x++){//resultSize is the size of your result
cells = new Vector(); //Cells together will represent a row
cells.add(yourResult.getTheFirstColumnForRowX()); //Pseudo-code
cells.add(yourResult.getTheSecondColumnForRowX()); //Pseudo-code
cells.add(yourResult.getTheThirdColumnForRowX()); //Pseudo-code
//Now place those cells into the rows vector
rows.add(cells);
//Create the JTable
table = new JTable(rows, headings);This code is not tested and is meant to give you an idea of how the concept can be applied. Hope it helps. -
Business Graphics:Create multiple Pie charts dynamically
Hi Experts,
I have a requirement to create 10 different pie chart in a view in a Grid layout.
The charts will be created dynamically because the data will be known at runtime.
Any type of help will be appreciated
Regards.Hi,
Here is a simple example:
you must write this code in wdDoModfy() method, in if (firstTime){}
in the layout there is already created one transperent container with id BG_CONTAINER
//add a node
IWDNodeInfo loDynNode = wdContext.getNodeInfo().addChild("DynNode", null, true, false, true, false, false, true, null, null, null);
//add some attributes to it
loDynNode.addAttribute("DynAttr1Str", "ddic:com.sap.dictionary.string");
loDynNode.addAttribute("DynAttr2Int", "ddic:com.sap.dictionary.integer");
//get the node
IWDNode node = wdContext.getChildNode("DynNode", 0);
//fill the node with some values
for (int i = 0; i < 10; i ++){
IWDNodeElement element = node.createElement();
element.setAttributeValue("DynAttr1Str", "Str value " + i);
element.setAttributeValue("DynAttr2Int", new Integer(i));
// Add to the content
node.addElement(element);
//get the attributes, we will use the attrinfo to bind them to the series
IWDAttributeInfo loDynAttr1StrInfo = loDynNode.getAttribute("DynAttr1Str");
IWDAttributeInfo loDynAttr2IntInfo = loDynNode.getAttribute("DynAttr2Int");
//create the graphics
IWDBusinessGraphics loGraphics = (IWDBusinessGraphics)view.createElement(IWDBusinessGraphics.class,"bg1");
//set the type to pie
loGraphics.setChartType(WDBusinessGraphicsType.PIE);
//create a simple series and bind the integer attribute to it
IWDSimpleSeries loSSeries = (IWDSimpleSeries)view.createElement(IWDSimpleSeries.class, "Series1");
loSSeries.bindValue(loDynAttr2IntInfo);
//create the category and bind the string attribute to it
IWDCategory loCategory = (IWDCategory)view.createElement(IWDCategory.class,"Category1");
loCategory.bindDescription(loDynAttr1StrInfo);
//add series and category
loGraphics.addSeries(loSSeries);
loGraphics.setCategory(loCategory);
//I assume that there is a transperent container already created design time to put the graphics there
//container with id BG_CONTAINER
IWDTransparentContainer loContainer = (IWDTransparentContainer)view.getElement("BG_CONTAINER");
//add the graphics
loContainer.addChild(loGraphics);
If this is the type of graphics you need then you must simply do a for cycle and supply the graphics with the right node elements and you are ready.
Best regards,
Anton -
Creating and loading 4000 shared variables
I need some help laying out the design of this system. The data is coming over reflective memory. I've written a dll and a simple server to do the interface between the reflective memory and shared variable engine. Everything seems to be working. The problem I am having is with scaling the application up to handle approximately 4000 variables. I have a spreadsheet to manage the reflective memory allocation and can use it to import the shared variable definitions with the names from the system that is writing the data.
I am having trouble deciding on the best way to proceed. I would like to read a buffer from reflective memory instead of reading 4000 times. I also would like the server to read in a file that defines the association between the shared variable and reflective memory address. The problem I am having is getting the data out of an array into each of the shared variables. I don't see a way to load the value of a shared variable using the property node (so that I can do this inside a loop). I also can't setup an alias that would access an array element. I don't want to manually create 4000 variables.
Any ideas would be appreciated. Thanks.I have never had to resort to creating Shared variables programatically so I will leave that for others.
I would cheat.
In LV 7.1 DSC i could import my tag config from a csv file. After importing and saving in LV 7.1 I could let LV create the SV's when the code is updated.
THat all assumes I will only have to do that one.
I have used the interupts fired when SCRAMNet locations update to "steer" the value to appropriate code which could then in turn update the SV using a datasocket write since I can compose the URL for the SV dynamically.
Just sharing ideas,
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
Creating and Accessing a Dynamic View Object
Hi,
I'm needing to create a Dynamic View Object so to have the ability to modify the FROM and WHERE clauses in an SQL statement.
I then need to view all the columns and rows in an adf table or something similar.
I've read up a fair bit on similar situations, however I'm struggling with the basic framework of building the View Object.
I know I'm wanting to use ..createViewObjectFromQueryStmt..but just unsure of the syntax in using it, especially connecting the VO to an Application Module.
This is similar to what I've got now, located in AppModuleImpl.java
public void createDynVO(ApplicationModule appMod, String FROMclause, String WHEREclause){
String SQL = "SELECT JOURNAL_NAME, PERIOD_NAME FROM " + FROMclause + " " + WHEREclause;
ViewObject vo = appMod.createViewObjectFromQueryStmt("DynamicView", SQL);
vo.executeQuery();But how does it know what the application module is?
Any help would be greatly appreciated!
-ChrisOk, I've actually modified my approach to this.
I've created a View Object in the design view, added it to the App Module, and then created an iterator and bound an adf table to that iterator.
The View Object which I created has the same column names as what I am going to be getting later down the track.
Everything is working perfectly, except that I can't seem to bind variables to the WHERE clause.
Below is what I have got running:
public void recreateDynView(String FromClause, String whereCompany, String whereDepartment) {
String sql_PAGE_ITEM1 = " AND PAGE_ITEM1 LIKE :P_PAGE_ITEM1";
String sql_PAGE_ITEM2 = " AND PAGE_ITEM2 LIKE :P_PAGE_ITEM2";
findViewObject("DynamicView1").remove();
String SQLStmt = "SELECT PAGE_ITEM1, PAGE_ITEM2, PAGE_ITEM3, LINE_ITEM FROM " + FromClause;
ViewObject vo = createViewObjectFromQueryStmt("DynamicView1",SQLStmt);
vo.setWhereClause("1=1");
if (whereCompany != null && whereCompany.length()>0){
vo.setWhereClause(vo.getWhereClause() + sql_PAGE_ITEM1);
vo.defineNamedWhereClauseParam("P_PAGE_ITEM1",null,null);
vo.setNamedWhereClauseParam("P_PAGE_ITEM1",whereCompany);
if (whereDepartment != null && whereDepartment.length()>0){
vo.setWhereClause(vo.getWhereClause() + sql_PAGE_ITEM2);
vo.defineNamedWhereClauseParam("P_PAGE_ITEM2",null,null);
vo.setNamedWhereClauseParam("P_PAGE_ITEM2",whereDepartment);
vo.executeQuery();
}However whenever I input a value into one of the bound variables, I get the following error on the page.
1. JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOperException, msg=JBO-25070: Where-clause param variable P_PAGE_ITEM1 needs ordinal index array.
2. JBO-25070: Where-clause param variable P_PAGE_ITEM1 needs ordinal index array.In the view object which i created at design stage, I've set the binding style to Oracle Named, so it should be alright. But obviously since I'm removing the view object and creating another version of it, it doesn't have the same binding style attached by default?
Is there a work around for this? I'm so close!
-Chris -
Create and execure a dynamic query
hi all,
i'm trying to write a procedure in order to create a dinamyc query and calculate a certain value.
i coded something like this but it does not work:
create or replace procedure CALCOLA_OPERAZIONE
is
sql_stmt varchar2(2000);
colonna varchar2(2000);
tabella varchar2(2000);
fattore varchar2(2000);
parametro number;
bt number := 0;
cursor cur is
select cod_colonna,cod_tabella,fattore_bt from table;
begin
open cur;
loop
fetch cur into colonna,tabella,fattore;
sql_stmt := 'select :1 * :2 into parametro from :3';
EXECUTE IMMEDIATE sql_stmt USING colonna,fattore,tabella;
bt:=bt+parametro;
end loop;
close cur;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
end;here the error i get:
An error was encountered - -903 -ERROR- ORA-00903: invalid table namecan anyone help me?
Edited by: 908335 on 6-feb-2012 1.30The good news is that what you want to do should be possible, but you need to take a different approach.
The bad news is that I agree with the others and think you need to take a step back and think about whether this is a good design. Dynamic SQL is a difficult solultion to implement and (within reason) static sql is almost always more maintaintable.
Still, if you're doing this as an exercise for your own knowledge or an assignment the technique is something like what I will put below (it will be untested). You will need to build the sql as text, execute it, and get the results. I prefer reference cursors for this kind of work although EXECUTE IMMEDIATE can be used. The solution will look something like (beware typos)
declare
ref_cursor sys_refcursor;
col varchar2(32767);
sql_text varchar2(32767);
value varchar2(1);
begin
col := 'dummy';
sql_text := 'select '||col||' from dual';
open ref_cursor using sql_text;
fetch ref_cursor into value;
close ref_cursor;
end;I will leave it up to you to figure out how to adapt what you have to work like this :) -
Creating and deleting symbols dynamically
I need help with getting this particular function implemented.
I have 2 buttons with codes which I've added
//Create button
$.getJSON("content.JSON")
.success(
function(data){
console.log("incoming data: ", data);
//console.log("this is current value of var s", template);
if (s == null)
$.each(data, function(index, item){
//var s = sym.createChildSymbol( "template", "content");
s = sym.createChildSymbol( "template", "content" );
// Creating the variable that save my new instance of mySymbol
sym.setVariable("itemContainer"+i, s);
console.log("item container name", s);
s.$("title").html( item.item );
s.$("description").html( item.description );
s.play(index * -500);
i++;
//console.log("'dressbtn' inside was CLICKED");
else
//Delete button
for(var p = 1; p <= i; p++)
s = sym.getVariable("itemContainer"+p);
s.deleteSymbol();
i = 1;
So the two buttons one will get the items from Json and display them, and the other will clear the symbols created.
But I've only managed to clear the symbols on stage only once, and after that I'm getting Javascript error in event handler! Event Type = element
The reason is because I'm trying to make an app that can get information off a json file from a webserver and able to update and display the lastest information in the app. So I've to be able to allow the user to press a button to refresh the page.
Can anyone shine some light on this?
Dropbox - test.zipHi,
Your issues (or troubles) come from your json file. Your json file is not well formed.
Here is a correct one:
{"shoes":[
{"item":"red shoe","description":"prada red shoe"},
{"item":"black shoe","description":"Black canvas shoe"},
{"item":"tilith shoe","description":"tilith ballet shoe"},
{"item":"gold shoe","description":"gold ballet shoe"},
{"item":"ganma shoe","description":"ganma canvas shoe"}
Then your buttons code:
1) mybtn.click:
//get json information and display
$.getJSON("content.JSON")
.success( function(data){
console.log("incoming data: ", data);
$.each( data.shoes, function(index, item){
var s = sym.createChildSymbol( "template", "content");
s.$("title").html( item.item );
s.$("description").html( item.description );
s.play(index * -500);
} );//each
} );//success
2) btn_2.click:
//deleting shoes (symbols)
var symbols = sym.getChildSymbols();
$.each(symbols, function(index, item){
console.log("symbols on stage: ",item.getSymbolTypeName());
if (item.getSymbolTypeName() == "template") item.deleteSymbol();
Download link: test-2 - copie.zip - Box -
How to create and use dynamic queue in JMS
Plz tell me how to create and use a dynamic queue in jms and can reciever file lookup it as it lookup any server configurred queue(written in the server).
Hi,
We can use Azure File services to do this, for more information, please have a look at this article:
http://blogs.msdn.com/b/windowsazurestorage/archive/2014/05/12/introducing-microsoft-azure-file-service.aspx. The Azure File service exposes file shares using the standard SMB 2.1 protocol. Applications running in Azure can now easily share files between
VMs using standard and familiar file system APIs like ReadFile and WriteFile.
Best Regards,
Jambor
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Embed fonts in Flash CS3 and load in Flex at runtime
Hi,
I want to embed fonts in the library of Flash CS3, compile it into a SWF and load it in my flex up at runtime and register the embedded font.
I'm able to get the linked class in Flex but the font doesn't show.
The FLA has a font called Viner Hand embedded as a library item, with linkage VinerHand and baseclass as flash.text.Font
Here's the code in flex to register the font -
var FontLibrary:Class = ApplicationDomain((event.target as LoaderInfo).applicationDomain).getDefinition('VinerHand') as Class;
Font.registerFont(FontLibrary);
When I do Font.enumerateFonts after this, I see [Font VinerHand] in the array but the textField doesn't show the font embedded.
NishantHi there,
Try taking a look at the following links:
http://www.trajiklyhip.com/blog/index.cfm/2007/7/18/Embedding-Fonts-in-Flex
http://blog.flexexamples.com/2007/10/25/embedding-fonts-from-a-flash-swf-file-into-a-flex- application/
Hope it helps.
With best regards,
Barna Biro -
Loading data dynamically to XML file
Hi ,
1) in my project i need an xml file that loads data
dynamically,i will get data using HttpService,
How to do this ?Please Help me its urgent.
2)Can i create an xml file that loads data dynamically using
Flex???Just need to clarify if you mean to load your data FROM an
XML file, which is relatively straightforward, or if you're saying
you want to WRITE an XML file based on something that's happened in
your application and store it on a server somewhere. -
Compiling (in memory) and Loading classes on fly
Hiya,
I have following classes:
public class Vehicle {Protected Sting reg;}
public class Car extends Vehicle
(public void print(){System.out.println(reg);}}
These classes (or different ones) are stored in one text file. The program must read these files then compile and load them dynamically in memory.
The link below authored by DCHSW deals with one class only (compile and loading) however it fails with more then one class particularly when it is subclassed.
http://forum.java.sun.com/thread.jsp?thread=347467&forum=4&message=1439418
How can we get the code mentioned at link above to compile (in memory) and load subclasses like the ones mentioned above.
Thanks
DerikHiya,
I have following classes:
public class Vehicle {Protected Sting reg;}
public class Car extends Vehicle
(public void print(){System.out.println(reg);}}
These classes (or different ones) are stored in one
text file. The program must read these files then
compile and load them dynamically in memory.
The link below authored by DCHSW deals with one class
only (compile and loading) however it fails with more
then one class particularly when it is subclassed.
Read the following post for full description of the problem
http://forum.java.sun.com/thread.jsp?forum=4&thread=417724
Any ideas?
Thanks
Derik
http://forum.java.sun.com/thread.jsp?thread=347467&foru
=4&message=1439418
How can we get the code mentioned at link above to
compile (in memory) and load subclasses like the ones
mentioned above.
Thanks
Derik -
READ XML file + XSD file to create an load data in a table
Hi gurus,
What way you will use to create and load data in a SQL TABLE by reading xml+xsd files.
Can you provide my a running example?
Is it better to stage the XML structure + XML data in the database before creating/loading the real SQL table. (the size of the XML file could me 1GB)See the FAQ..
For very large files make sure
1. Use FTP to load...
2. Ensure schema is registered with storeVarrayAsTable="true" and maintainDOM="false'
3. Install latest 10.2.0.3.0...
or
Look for SaxLoader example in the FAQ
-M -
I cannot get the accordion load event to fire when I have
created the accordion and load event using actionscript . Here is
some sample code:
createClassObject(mx.containers.Accordion, "acc",
getNextHighestDepth());
acc.createSegment(mx.containers.ScrollPane, "sc1", "Number
One");
acc.createSegment(mx.containers.ScrollPane, "sc2", "Number
Two");
var accLis=new Object();
accLis.load=function(evtObj) {
trace("load");
accLis.change=function(evtObj) {
trace("change");
acc.addEventListener("load", accLis);
acc.addEventListener("change", accLis);
I made sure to add the ScrollPane and Accordion components
to my library. So the load event does not fire, but the change
event does fire. And through further testing the other events do
not fire, including the draw event. Can anyone help? The only time
I can get the load event to fire on an accordion is if I put an
accordion on stage, select it and add the actionscript to the
objects actions like shown below:
on(load) {
trace("load");
on(draw) {
trace("draw");
Can somebody help? Unfortunately I must create all my
components dynamically. Thank you in advance.I'm having this issue also...but only apparently with Internet Explorer and only on some machines...ideas?
-
I have a requirement to use mx.charts in my mobile application, as suggested in the below article
http://www.adobe.com/devnet/flex/articles/mobile_development_hero_burrito.html#articlecont entAdobe_numberedheader_3g
I have added the datavisualization.swc and mx.swc into the library path , but am still not able to refrence any charts. Am not sure if i need to change the namespace or something.
If anyone has created a mobile application using Hero and mx.charts please let me know what i need to do to solve this ..
Thanks in advance.I have managed to get mx charts to compile and deploy in Burrito Mobile Applications by creating custom name spaces, for example:
xmlns:charts="mx.charts.*"
xmlns:series="mx.charts.series.*"
xmlns:chartClasses="mx.charts.chartClasses.*"
Then referencing these in the charts:
<chartClasses:CartesianChart....
I have included datavisualization.swc, mx.swc and sparkskins.swc in my path.
Maybe you are looking for
-
Change detail frame size from page 1 to page 2?
Hello, I wish to build a report for invoice printing, where the first page on each invoice has one layout but the following pages have another. Is this possible? Page one has three sections: 1) Invoice info 2) As many invoice lines as can fit between
-
-
When I try to update my iPod touch to iOS4.3 I'm told to go to Devices in iTunes, then Summary. I can't find Summary.
-
How can I redownload Photoshop Elements 11 for installing on a new PC
I need help for redownload the program I bought
-
WSUS 6 upstream server will support WSUS 3 SP2 downstream server or not
In our company WSUS upstream server operating system is windows 2012 r2. I would like to know can we install downstream server in windows 2008 r2 (WSUS 3.0 sp2) it will download approved patches from upstream server. WSUS 6 upstream server will suppo