Graph in flex
First of all hello to all of the great poster here.
As i m newbie in flex. my problem is
Ho w to add different multiple graph in at runtime in flex.
can any body help me.
Please help me.
Regards
vish
"dfgdgddfgd" <[email protected]> wrote in
message
news:gdhaqj$5rh$[email protected]..
> Ho w to add diffrent multiple graph in at runtime in
flex.
http://flexdiary.blogspot.com/2008/08/charting-example.html
Similar Messages
-
Flex, JSON and moving graphs
Dear all,
I've got a few questions about Flex.
1. How do I encode JSON objects in Flex? Can datagrid
recognize this JSON object straight away?
2. How do I implement moving graphs in Flex?
Thank you in advance.Hi,
No, DataGrid cannot understand JSON. Please check the URL
below for details on Flex and JSON.
http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscri pt-3/
Hope this helps. -
Revision: 1176
Author: [email protected]
Date: 2008-04-10 10:38:20 -0700 (Thu, 10 Apr 2008)
Log Message:
compiler: moving all the graphing classes to... the util.graph package (ala asc)!
Bugs: n/a
QA: No
Doc: No
Modified Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerAPI.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcMovie.java
flex/sdk/trunk/modules/compiler/src/java/flex2/linker/ConsoleApplication.java
flex/sdk/trunk/modules/compiler/src/java/flex2/linker/DependencyWalker.java
flex/sdk/trunk/modules/compiler/src/java/flex2/linker/FlexMovie.java
flex/sdk/trunk/modules/compiler/src/java/flex2/linker/SimpleMovie.java
flex/sdk/trunk/modules/compiler/src/java/flex2/tools/oem/Project.java
Added Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Algorithms.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/DependencyGraph.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Edge.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Graph.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Vertex.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Visitor.java
Removed Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/DependencyGraph.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Algorithms.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Edge.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Graph.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Vertex.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Visitor.javaWe had this same case. I used web adi to moved the the classes to the right catalogues/offerings. Use the OTA_EVENT_API.UPDATE_CLASS procedure and OTA_EVENTS_V view to get all class listings. Find the right activity_version_id and parent_offering_id of the catalogue you want the classes to moved to. Use this values to change the values of the activity_version_id and parent_offering_id of the classes you will be moving.
-
Revision: 1183
Author: [email protected]
Date: 2008-04-10 14:10:12 -0700 (Thu, 10 Apr 2008)
Log Message:
compiler: Finished off generics warnings in graph, they're bulletproof now (as long as they're not rounds of depleted uranium).
* Improved the generics in other places and took advantage of enhanced for loops in some nasty iterators
Bugs: n/a
QA: Yes, I'm done with the cleanup so it's a good time to run the suite and see what damage I have done!
Doc: No
Modified Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/Assets.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerAPI.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Algorithms.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/DependencyGraph.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Edge.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Graph.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Vertex.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Visitor.java
flex/sdk/trunk/modules/compiler/src/java/flex2/linker/ConsoleApplication.java
flex/sdk/trunk/modules/compiler/src/java/flex2/linker/SimpleMovie.java
flex/sdk/trunk/modules/compiler/src/java/flex2/tools/CompcPreLink.java
flex/sdk/trunk/modules/compiler/src/java/flex2/tools/Mxmlc.java
flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java
flex/sdk/trunk/modules/compiler/src/java/flex2/tools/oem/Project.javaDid you read the comments, either on the AUR page or in the output that you posted? They explain it.
-
Hi,
According to my current requirement I need to create graphs where I read some part of input from CSV & the rest part of the input is calculated by using different Formulae.Can i get such kind of graph using Flex Professional.Can any one suggest better ways to achieve this.I request to forward any examples of this type.
Regards
Kalavati Singh
[email protected]Hi Claptrap,
I am not sure what exactly is your problem , but if it is just about clearing the chart after each run, you can righclick the graph when its blank and in data operation set it as default value. Then in the block diagram use an invoke node with reinitialize all to default property befor starting the while loop. Check the attached VI for more details. This will make the graph start from 0 evrytime you run the VI.
Regards,
Nitzz
(Give kudos to good Answers and Mark it as a Solution if your problem is Solved)
Attachments:
test panel (1).vi 99 KB -
Revision: 15781
Revision: 15781
Author: [email protected]
Date: 2010-04-27 21:27:51 -0700 (Tue, 27 Apr 2010)
Log Message:
Package and class level javadoc for the flex2.compiler.swc and
flex2.compiler.util packages and their subpackages.
QE notes:
Doc notes:
Bugs:
Reviewer: Corey (post commit)
Tests run: checkintests
Is noteworthy for integration: NO
Modified Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/Digest.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/Swc.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcAPI.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcArchive.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcCache.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcComponent.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcDependencySet.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcDirectoryArchive.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcException.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcFeatures.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcFile.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcGroup.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcLazyReadArchive.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcLibrary.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcMovie.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcPathResolver.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcScript.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/SwcWriteOnlyArchive.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/Versions.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/catalog/CatalogReadElement.ja va
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/catalog/CatalogReader.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/catalog/CatalogWriter.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/catalog/ReadContext.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/AbstractLogger.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Benchmark.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/CompilerControl.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/ConsoleLogger.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/DualModeLineNumberMap.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/IteratorList.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/LineNumberMap.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/LinkedQNameMap.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/ManifestParser.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/MultiNameMap.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/NameFormatter.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/NameMappings.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/OrderedProperties.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/PerformanceData.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/PrefixMapping.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/QNameList.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/QNameMap.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/QNameSet.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/SwcDependencyInfo.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/SwcDependencyInfoImpl.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/SwcDependencyUtil.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/SwcExternalScriptInfo.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/SwcExternalScriptInfoImpl.ja va
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/ThreadLocalToolkit.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/TraceExtension.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/URLPathResolver.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/VelocityException.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/VelocityManager.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/XMLStringSerializer.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Algorithms.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/DependencyGraph.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Edge.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Graph.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Vertex.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/Visitor.java
Added Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/catalog/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/swc/zip/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/graph/package.html
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/package.html -
Noges and Edges(graph) representation in Flex
Hi,
We want to develop a component to render a graph representing nodes and edges using flex without using a third party API.
Can anyone share your views or how can it be done?
Thanks & Regards,
MadhaviHi,
You can make your own charts (Bar, Pie etc etc). U would have to use drawnig API of flash.
Can read on it @ http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7dce.html
Using Graphics class you can make your own logic to make different charts.
For reference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Graphics. html?filter_flex=4.1&filter_flashplayer=10.1&filter_air=2
Thanks.
Abhinav -
Converting Flex Graphs to PDF/JPEG
We'd love to use Flex in our application. However, we would
need a way to convert Flash components (or an entire SWF) to a
PDF/JPEG.
We've created a Flex application that allows users to create
their own charts and we will even have the ability to generate a
simple SWF file for each chart (using the command line compiler).
Is there a way (or any ideas about a possible way) to do
*any* of these things? --
- Convert a static SWF file to PDF
- Convert a static SWF file to JPEG/PNG/TIF/ETC
- Grab a 'screenshot' of a Flex Component
- Anything else that would do the job
I've looked around for a product that would do any of the
above, but I can't find anything that could be accessed
programmatically (i.e. called via a script).The answer is yes. Here is a thread that should answer your
question. I
updated the PNGEncoder.as to compile with Beta3. However, I
have not tested
that it works in Beta3.
Original Question:
Specifically we need to export a bitmap (in any format,
preferably PNG, but
jpg or GIF will do) from the application. These bitmaps
should be pixel
perfect replicas of chart controls within the application. We
were
originally told that this was not possible in Flex 1.5. It
appears however
that in Flex 2.0, the BitmapData class of the Flash 8 player
is now exposed,
and with a little research it seems like we should be able to
use it to
access a Flex chart, pixel by pixel and send the data back to
the server for
rendering as an image file.
So I have a couple questions:
1.. Is the approach I have outlined above workable?
2.. Does this approach require Flex 2.0?
3.. Is there a better way of exporting a bitmap image of a
Flex control?
Response:
1) You don't need to pull the data pixel by pixel. You can
create a
BitmapData, draw() the chart into the bitmap, and ask for its
bits as a
bytearray.
2) Your best bet is to compress the bitmapData into a PNG and
send that to
the server. The server does nothing but turn around and send
it right back
in the response with the appropriate headers to trigger the
browser to pop
up a save dialog.
3) I've attached some prototype code I wrote a while back to
turn a Bitmap
into a PNG. It was written against a pre-alpha build, so it
will need some
work. It's also not fully functional I think. Specifically, I
know that when
the size of the image crosses a boundary you need to split it
up into chunks
as you write it out into the file, which this code isn't
doing. THere may be
other problems too.
4) Yes, this only works in Flex 2.
PNGEncoder.as:
package {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.net.*;
public class PNGEncoder {
private var _png:ByteArray;
public function encode(img:BitmapData):ByteArray
var imgWidth:uint = img.width;
var imgHeight:uint = img.height;
var imgData:ByteArray = img.getPixels(new
Rectangle(0,0,imgWidth,imgHeight));
_png = new ByteArray();
_png.writeByte(137);
_png.writeByte(80);
_png.writeByte(78);
_png.writeByte(71);
_png.writeByte(13);
_png.writeByte(10);
_png.writeByte(26);
_png.writeByte(10);
var IHDR:ByteArray = new ByteArray();
IHDR.writeInt(imgWidth);
IHDR.writeInt(imgHeight);
IHDR.writeByte(8); // color depth: 8 bpp
IHDR.writeByte(6); // color type: RGBA
IHDR.writeByte(0); // compression: ZLIB
IHDR.writeByte(0); // filter method
IHDR.writeByte(0); // not interlaced;
writeChunk([0x49,0x48,0x44,0x52],IHDR);
var IDAT:ByteArray= new ByteArray();
for(var i:uint=0;i<imgHeight;i++) {
IDAT.writeByte(0);
for(var j:uint=0;j<imgWidth;j++) {
var p:uint = img.getPixel32(j,i);
IDAT.writeByte((p>>16)&0xFF);
IDAT.writeByte((p>> 8)&0xFF);
IDAT.writeByte((p )&0xFF);
IDAT.writeByte((p>>24)&0xFF);
IDAT.compress();
writeChunk([0x49,0x44,0x41,0x54],IDAT);
writeChunk([0x49,0x45,0x4E,0x44],null);
return _png;
public function dump():String
_png.position = 0;
var out:String ="";
for(var i:uint=0;i<_png.length;i++) {
var code:String = "0123456789abcdef";
var v:uint = _png.readUnsignedByte();
out += code.charAt((v & 0xF0) >> 4);
out += code.charAt(v & 0xF);
out += " ";
return out;
private function writeChunk(type:Array,data:ByteArray):void
var len:uint = 0;
if(data != null)
len = data.length; // data length
_png.writeUnsignedInt(len);
var p:uint = _png.position;
_png.writeByte(type[0]);
_png.writeByte(type[1]);
_png.writeByte(type[2]);
_png.writeByte(type[3]);
if(data != null)
_png.writeBytes(data);
var endP:uint = _png.position;
_png.position = p;
var c:uint = crc(_png,endP-p);
_png.position = endP;
_png.writeUnsignedInt(c);
/* Table of CRCs of all 8-bit messages. */
private static var crc_table:Array;
/* Flag: has the table been computed? Initially false. */
private static var crc_table_computed:Boolean = false;
/* Make the table for a fast CRC. */
private function make_crc_table():void
var c:uint;
var n:int;
var k:int;
crc_table = [];
for (n = 0; n < 256; n++) {
c = n;
for (k = 0; k < 8; k++) {
if (c & 1)
c = uint(uint(0xedb88320) ^ uint(c >>> 1));
else
c = uint(c >>> 1);
crc_table[n] = c;
crc_table_computed = true;
/* Update a running CRC with the bytes buf[0..len-1]--the
CRC
should be initialized to all 1's, and the transmitted value
is the 1's complement of the final running CRC (see the
crc() routine below)). */
private function update_crc(crc:uint, buf:ByteArray,
len:uint):uint
var c:uint = crc;
var n:int;
var v:uint;
if (!crc_table_computed)
make_crc_table();
for (n = 0; n < len; n++) {
v = buf.readUnsignedByte();
c = uint(crc_table[(c ^ v) & uint(0xff)] ^ uint(c
>>> 8));
return c;
/* Return the CRC of the bytes buf[0..len-1]. */
private function crc(buf:ByteArray, len:uint):uint
var cc:uint = update_crc(uint(0xffffffff), buf, len);
return uint(cc ^ uint(0xffffffff));
Jason Szeto
Adobe Flex SDK Developer
"jeb1138" <[email protected]> wrote in
message
news:[email protected]...
> We'd love to use Flex in our application. However, we
would need a way to
> convert some resulting Flash components (or an entire
SWF) to a PDF/JPEG.
>
> We've created a Flex application that allows users to
create their own
> charts
> and we will even have the ability to generate a simple
SWF file for each
> chart
> (using the command line compiler).
>
> Is there a way (or any ideas about a possible way) to do
*any* of these
> things? --
> - Convert a static SWF file to PDF
> - Convert a static SWF file to JPEG/PNG/TIF/ETC
> - Grab a 'screenshot' of a Flex Component
> - Anything else that would do the job
>
> I've looked around for a product that would do any of
the above, but I
> can't
> find anything that could be accessed programmatically
(i.e. called via a
> script).
> -
FMIS vs LCDS for Real Time Messaging In Flex
A team that I am working with is launching development for a new Flex app. The app will have multiple text chat rooms and video chat too.
Since for video the architecture must include Flash Media Interactive Server (FMIS), the client assumes we will use FMIS for the text messaging.
My question is, for text chat what advantages does LiveCycle Data Services (LCDS) have over FMIS?
Does anyone here have experience with both that they can comment on? Can anyone provide links that might compare the pros and cons of LCDS vs FMIS? Or, dream come true, links providing comparisons of LCDS vs FMIS vs BlazeDS?
Any thoughts or assistance will be appreciated.
Thanks,
g
Flash Media Server FMS> from mili to micro seconds. When I right click on the graph, in the
> xscale formating when i change the dX, it does not really alter the
> scale, meaning the waveform does not expand.Sure, the scale changes,
> but now the time period of the waveform is 1micro second instead of 1
> milli second.
It sounds like you are changing the multiplier sometimes called the dX
on the graph scale. This changes how the graph is labeled, which is
sort of a unit or timescale change, but it doesn't affect the numeric
formatting of the scale. On the same dialog, as well as on the popup
are items for choosing scientific display or choosing digits after the
decimal to display, if that is what you are interested in seeing.
When you say you want to expand the waveform,
you might also want to
type into the min and max of the scale to view less data in the graph,
thus leaving more detail on what is viewed. This is effectively
zooming. If I still haven't guessed what it is you are trying to
change, please explain your problem again in more detail or post a VI.
As for choosing between a chart and a graph. The major difference is
that a chart shows the new data attached to older historical data. If
you are looking at individually sampled blocks of data, the graph is
what you want. If you want to look at a window on all of the data you
have gathered, a chart may work better. Also keep in mind that graphs
have cursors, charts do not. If your chart's data isn't a waveform,
then the X axis is simply samples and it tells the chart nothing about
phase.
Greg McKaskle -
Flex 3/4 Initialization Timing Changes?
Hi there. This isn't end-of-the-world critical, but I'm trying to better understand what's going on here.
We have a relatively large and complex business app (several hundred classes split into a core application framework plus multiple dynamically-loaded product modules), originally written in Flex 3.2. As part of our new release, we are taking the chance to port it over to Flex 4.5; I've spent the past week doing so. We're continuing to use the Halo theme for the time being, to minimize the initial disruption.
I've pretty much gotten it working, but I'm still trying to understand the key behaviour change that I've observed. A lot of our code is failing at initialization time. I'm still nailing down exactly what's different, but the most obvious bit is that it seems like, in commitProperties(), properties that refer to other objects in the same parent don't exist yet, where they previously did. So I'm getting null pointer exceptions where I wasn't previously.
Similarly, I have a few objects where the property refers to the object itself. They're graphing objects, which have a property that describes how to set up the dataFunction. This property is typically set to one of several functions available on the object. So graph "foo" would set this function to "foo.useDateForY" or some such, using one of these utility functions on the class that says how to set up the graph. This previously worked, but now the property is failing because "foo" is null when it is trying to resolve the property value. This seems likely to be related to the above.
Finally, I've also observed what appear to be differences in the resolution of the lifecycle for non-visible objects. Again, I haven't had time to nail this down precisely, but it feels like I used to get CREATION_COMPLETE in a bunch of cases that aren't getting it any more -- specifically, this seems to be happening for objects that I'm building up before adding them to the visible graph. I build lots of screens upfront when a product is loaded, but don't actually add them into the tab structure until they are invoked. Similarly, we have popups that we want to be populating as we go, long before they are displayed, but I don't seem to be getting CREATION_COMPLETE for them when I used to.
So it seems like something has changed subtly in the UIComponent lifecycle, having to do with the timing of resolving IDs, setting properties to them, and calling commitProperties(); maybe also something having to do with how parenting relates to finishing the lifecycle. Does anybody have a clue what I'm talking about here? And is there a document somewhere that describes the timing changes more clearly? I've seen several documents talking about 3 -> 4 changes, but haven't noticed anything on this particular topic...Yes, the timing of when child objects are created has changed relative to
when the constructor runs, but the lifecycle methods and events have not
changed. If you rely on commitProperties to resolve things, it should be
ok.
The only cases I've seen where creationComplete doesn't fire is if there is
an invalidation loop going on which is slightly more possible if using
multiline text controls whose height depends on width or vice-versa. -
Is it possible to export of the stage of a Flex application in vector format?
Is it possible to export of the stage of a Flex application in vector format?
Right now our only option is to render our graphs to a (large, off-screen) bitmap and export that bitmap, which is a real shame because every
component in Wondergraphs is 100% vector based. Anyone at Adobe know more about this?Hi.
Try start->search for pen and touch--> then uncheck "Use your finger as an input device" in the Touch tab. -
Charts in Flex 3 compatibility mode are hosed
I spent an 11 hour day struggling to get a LineChart working in Flex 3 compatibility mode that worked fine otherwise. I encountered a multitude of problems, spent hours tracing through Flex code, and finally have something almost working except for minor details like the horizontal axis insists on displaying on the top only (and the vertical on the right) even if I use the axis renderer placement tags to specify otherwise (and with any other values except "bottom" and "left" the data does not draw properly!). To give you a feeling for what I learned, a major breakthrough was setting gutters explicitly (the data points were calculated as NaN otherwise).
If someone could suggest what might need setting to get the axes to display where I want them to I will be very grateful.
To summarize -- LineCharts appear to be badly broken in Flex 3 compatibility mode.
If an Adobe developer would like to verify, here is my source, including an example of the data I'm using. I posted earlier today wondering what the situation is and give some more details there.
Thanks, Peter ([email protected])
<?xml version="1.0"?>
<!-- charts/BasicLine.mxml -->
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:bwc="*"
creationComplete="initialization()"
width="1200" height="800" layout="absolute" >
<mx:Label id="titleLabel" x="30" y="10" text="Progress Chart for " fontSize="16" />
<!--mx:Label id="measureLabel" x="688" y="25" text="Measure:" fontSize="12" width="67"/-->
<mx:ComboBox id="measureCombo" x="300" y="14" width="300" dataProvider="{patientMeasureNames}"
editable="false" change="loadPatientData()" />
<mx:SolidColorStroke id="axisStroke"
color="#000000"
weight="2"
alpha="1"
caps="square" />
<mx:SolidColorStroke id="tickStroke"
color="#000000"
weight="1"
alpha="1" />
<mx:SolidColorStroke id="minorTickStroke"
color="#000000"
weight="1"
alpha="1" />
<mx:SolidColorStroke id="dataStroke"
color="0x11538C"
weight="3"
alpha="1" />
<mx:Canvas id="chartCanvas" x="30" y="50" width="600" height="500" borderStyle="solid" >
<mx:LineChart id="progressChart" x="10" y="10" width="550" height="450"
dataProvider="{patientData}"
showDataTips="true"
horizontalAxisStyleNames="{styleNames}" verticalAxisStyleNames="{styleNames}"
gutterBottom="10" gutterLeft="10" gutterRight="10" gutterTop="10" gridLinesStyleName=""
>
<mx:annotationElements>
<mx:CartesianDataCanvas id="annotationCanvas" includeInRanges="true" width="800" height="400"/>
</mx:annotationElements>
<mx:horizontalAxis>
<mx:DateTimeAxis id="hAxis" parseFunction="makeDateFromString"
alignLabelsToUnits="true" displayLocalTime="true"
title="" labelFunction="formatDateLabel" maximum="{maxDate}"
/> <!-- -->
</mx:horizontalAxis>
<mx:verticalAxis>
<mx:LinearAxis id="vAxis" interval="1" maximum="{this.maxValue}" title="" /> <!-- -->
</mx:verticalAxis>
<mx:series>
<bwc:BwcLineSeries xField="date" yField="value" displayName="(measure)" stroke="{dataStroke}"
itemRenderer="mx.charts.renderers.CircleItemRenderer"
lineSegmentRenderer="mx.charts.renderers.LineRenderer"
width="700" height="350" lineStroke="{dataStroke}" radius="4"
>
</bwc:BwcLineSeries>
</mx:series>
<mx:seriesFilters>
<mx:Array/>
</mx:seriesFilters>
<mx:horizontalAxisRenderers>
<mx:AxisRenderer axis="{hAxis}"
axisStroke="{axisStroke}" tickStroke="{tickStroke}" minorTickStroke="{minorTickStroke}"
showLine="true" showLabels="true" labelRenderer="mx.charts.chartClasses.ChartLabel"
placement="bottom" tickPlacement="cross" tickLength="5" fontSize="12"
/>
</mx:horizontalAxisRenderers>
<mx:verticalAxisRenderers>
<mx:AxisRenderer axis="{vAxis}"
axisStroke="{axisStroke}" tickStroke="{tickStroke}" minorTickStroke="{minorTickStroke}"
showLine="true" showLabels="true" labelRenderer="mx.charts.chartClasses.ChartLabel"
placement="left" tickPlacement="cross" tickLength="5" fontSize="12"
/>
</mx:verticalAxisRenderers>
</mx:LineChart>
<!--mx:Legend id="chartLegend"
x="20" y="{chartCanvas.height - chartLegend.height - 20}"
dataProvider="{progressChart}" /-->
</mx:Canvas>
<mx:Script>
<![CDATA[
import com.bewellcommunication.pvg.model.BackendService;
import com.bewellcommunication.pvg.model.Utilities;
import flash.events.TimerEvent;
import mx.charts.chartClasses.IAxis;
import mx.charts.series.items.LineSeriesItem;
import mx.collections.ArrayCollection;
import mx.collections.XMLListCollection;
import mx.controls.RadioButton;
import mx.controls.RadioButtonGroup;
import mx.rpc.events.ResultEvent;
[Bindable]
private var patientMeasureNames:ArrayCollection;
private var patientMeasureIds:Array;
private var dataVideoIds:Array;
private var videoButtons:Array;
[Bindable]
private var patientData:XMLListCollection;
[Bindable]
private var maxDate:Date;
[Bindable]
private var maxValue:Number;
[Bindable]
private var styleNames:Array = new Array("axisStroke");
private function initialization():void
var service:BackendService = new BackendService();
var xml:String = "<LoadPatientMeasures>"
+ "\n<clientId>" + 2 + "</clientId>"
+ "\n</LoadPatientMeasures>";
service.request(xml, loadPatientMeasuresFinish);
public function loadPatientMeasuresFinish(re:ResultEvent):void
var xmlResult:XML = XML(re.result.valueOf().toString());
var error:String = xmlResult.error;
if (error != null && error != "")
trace(xmlResult.error + "Problem loading patient measures"); // PENDING: bwcAlert
else
this.patientMeasureNames = new ArrayCollection();
this.patientMeasureNames.addItem("(Select measure)");
this.patientMeasureIds = new Array();
this.patientMeasureIds.push(0);
var xmlMeasures:XMLList = xmlResult.measures.children();
for each (var xmlMeasure:Object in xmlMeasures)
this.patientMeasureIds.push(Number(xmlMeasure.measureId));
var name:String = xmlMeasure.measureName; // PENDING: utils.makeSafe()
this.patientMeasureNames.addItem(name);
public function loadPatientData():void
var measureIndex:int = this.measureCombo.selectedIndex;
if (measureIndex < 1)
return;
var service:BackendService = new BackendService();
var xml:String = "<LoadPatientData>"
+ "\n<clientId>" + 2 + "</clientId>"
+ "\n<measureId>" + this.patientMeasureIds[measureIndex] + "</measureId>"
+ "\n</LoadPatientData>";
service.request(xml, loadPatientDataFinish);
public function loadPatientDataFinish(re:ResultEvent):void
var xmlResult:XML = XML(re.result.valueOf().toString());
var error:String = xmlResult.error;
if (error != null && error != "")
trace(xmlResult.error + "Problem loading patient data"); // PENDING: bwcAlert
else
// re-initialize
this.annotationCanvas.removeAllChildren();
// set data for graphing
this.patientData = new XMLListCollection(xmlResult.results.result);
this.dataVideoIds = new Array();
// calculate mins and maximums for axis spacing
var xmlResults:XMLList = xmlResult.results.children();
var minDate:Number = Number.MAX_VALUE;
var maxDate:Number = Number.MIN_VALUE;
var minVal:Number = Number.MAX_VALUE;
var maxVal:Number = Number.MIN_VALUE;
for each (var result:Object in xmlResults)
var date:Number = Number(result.date);
var val:Number = Number(result.value);
if (!isNaN(val))
if (date < minDate)
minDate = date;
if (date > maxDate)
maxDate = date;
if (val < minVal)
minVal = val;
if (val > maxVal)
maxVal = val;
// also store the video id
var videoId:Number = Number(result.videoId);
this.dataVideoIds.push(videoId);
// set scale max for each axis
this.maxDate = new Date(maxDate + ((maxDate - minDate) * 0.1));
this.maxValue = maxVal * 1.1;
// draw links to videos
var utils:Utilities = new Utilities();
utils.relinquishThenFinish(drawLinksToVideos, 500);
private function drawLinksToVideos(e:TimerEvent):void
var rect:Rectangle = new Rectangle(0, 0, 99999, 99999); // get all items
var items:Array = this.progressChart.getItemsInRegion(rect);
var i:int;
var rbg:RadioButtonGroup = new RadioButtonGroup(this.annotationCanvas);
this.videoButtons = new Array();
for (i = 0; i < items.length; i++)
var liveButton:RadioButton = null;
if (this.dataVideoIds[i] > 0)
var item:LineSeriesItem = items[i];
var radio:RadioButton = new RadioButton();
radio.group = rbg;
liveButton = radio;
radio.addEventListener(Event.CHANGE, loadAndPlayVideo);
this.annotationCanvas.addDataChild(radio, item.xValue, item.yValue);
this.videoButtons.push(liveButton); // one for each item
private function loadAndPlayVideo(e:Event):void
var utils:Utilities = new Utilities();
utils.relinquishThenFinish(finishLoadAndPlayVideo);
private function finishLoadAndPlayVideo(e:TimerEvent):void
// identify video to play
var i:int;
var target:int = -1;
for (i=0; target == -1 && i < this.videoButtons.length; i++)
var radio:RadioButton = this.videoButtons[i] as RadioButton;
if (radio != null && radio.selected)
target = i;
// play video
if (target > -1)
trace("play video: index=" + target + " id=" + this.dataVideoIds[target]);
private function makeDateFromString(dateStr:String):Date
var dateNum:Number = Number(dateStr);
var date:Date = new Date(dateNum);
trace("date=" + date.toLocaleString());
return date;
private function formatDateLabel(cur:Date, prev:Date, axis:IAxis):String
var label:String = cur.month + "/" + cur.date + " " + cur.hours + ":" + cur.minutes;
return label;
]]>
</mx:Script>
</mx:Application>
package
import mx.charts.series.LineSeries;
public class BwcLineSeries extends LineSeries
public function BwcLineSeries()
super();
override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
var useWidth:Number = unscaledWidth;
var useHeight:Number = unscaledHeight;
/*if (isNaN(useWidth))
useWidth = 745.5;
useHeight = 365;
super.updateDisplayList(useWidth, useHeight);
<data>
<measure/>
<results>
<result>
<date>1276613823585</date>
<value>180.0</value>
<videoId>0</videoId>
</result>
<result>
<date>1276613923383</date>
<value>170.0</value>
<videoId>0</videoId>
</result>
<result>
<date>1276614556024</date>
<value>210.0</value>
<videoId>0</videoId>
</result>
<result>
<date>1276628450502</date>
<value>150.0</value>
<videoId>104</videoId>
</result>
<result>
<date>1276628667114</date>
<value>180.0</value>
<videoId>106</videoId>
</result>
</results>
</data>@Jason Villmer,
I believe the issue you're describing is http://bugs.adobe.com/jira/browse/SDK-26940.
There is a workaround listed in the bug report which should work (based on my testing), or you could probably set the direction and layoutDirection styles globally using a Style block.
Peter -
Hi all,
I am new to Flex/Flash Builder, actionscript, and mxml, so please be kind.
I have developed a small program that has a component that displays a datagrid fed with information out of a mysql db via a php data services connection. Within that same component (page), I have a graph that charts the dates via a plot chart. I am interested in adding a line series to the graph, but the data I want to use is a calculated field in the datagrid which I used a custom lable function to derive and display. Can someone steer me to the correct method to store such values and how to call them into a chart?
Some addition information
Custom label function:
/* Custom label function for the Delta1 column. Calculates the number of days between the planting date and 10% flower. */
private function calculateTo1stFlower(item:Object, column:GridColumn):String {
var tempDate1:Date = new Date(item.dflower10 - item.dplanting);
return Math.round((tempDate1.time / MS_PER_DAY) + 1).toString();
/* Number of milliseconds in a day. (1000 milliseconds per second * 60 seconds per minute * 60 minutes per hour * 24 hours per day) */
private const MS_PER_DAY:uint = 1000 * 60 * 60 * 24;
Within my spark datagrid
<s:GridColumn width="30" headerText="Δ1" labelFunction="calculateTo1stFlower" ></s:GridColumn>
I assume I need to store the array of values for this column and then chart the saved values as the xField within the LineSeries. Should I use a class based model?
The following link seemed like it may be an appropriate path; I am not sure though.
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7b51.html
Thanks in advance for any support,
MatthewThanks for trying to post DDL, but you have no idea how to do a data model. You do not know that tables have to have keys, what ISO-11179 is, etc.
You have a table that is supposed to model companies. Your singular names says that there is only one company! There is no company identifier (the industry standard is the DUNS). A customer is not a company. We do not use numeric data types for identifiers;
do you do math on them? NO! The attribute property comes after the attribute name (you never heard of ISO-11179).
Think about how silly VARCHAR(1) is.
CREATE TABLE Companies
(company_duns CHAR(9) NOT NULL PRIMARY KEY,
company_name VARCHAR(30)NOIT NULL,
margin_oil INTEGER NOT NULL,
margin_hangar INTEGER NOT NULL,
margin_cleaning INTEGER NOT NULL);
INSERT INTO Companies
VALUES (1, 'AviatKorea', 100, 125, 200),
(2, 'AXHollande', 50, 40, 30),
(3, 'BFXNorway', 60, 80, 600),
(4, 'EEEFrance', 10, 25, 60);
CREATE TABLE Company_Tariffs
(company_duns INTEGER NOT NULL
REFERENCES Companies(company_duns),
tariff_type CHAR(1) NOT NULL
CHECK (tariff_type IN ('A','B','C','D'),
PRIMARY KEY (company_duns, tariff_type));
INSERT INTO Company_Tariffs values (1, 'A'), (2, 'C'), (2, 'D'), (3, 'A'), (4, 'A'), (4, 'C'), (4, 'D')
SELECT * -- do not use * in production code
FROM Companies AS C,
Company_Tariffs AS T
WHERE C.company_duns = T.company_duns;
>> I would like something like with a computed column [ ] that retrieves the different contracts used: <<
You might but a SQL programmer would not. This violated First Normal Form. It is a display report and is done in the presentation layers.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
Facebook actionscript API not working with Flex 4.5 Mobile Project
Will the following API work in a Flex 4.5 mobile project?
http://code.google.com/p/facebook-actionscript-api/
I tried a simple Facebook.int() and I keep getting the following error...
Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.
at Error$/throwError()
at flash.external::ExternalInterface$/addCallback()
at com.facebook.graph::Facebook/init()[C:\Users\MikeHunt\Work\facebookGraphApi\api\com\faceb ook\graph\Facebook.as:599]
at com.facebook.graph::Facebook$/init()[C:\Users\MikeHunt\Work\facebookGraphApi\api\com\face book\graph\Facebook.as:165]
at views::LoginView/init()[/Users/edgar/Documents/Adobe Flash Builder 4.5/socialMessenger/src/views/LoginView.mxml:15]
at views::LoginView/___LoginView_View1_initialize()[/Users/edgar/Documents/Adobe Flash Builder 4.5/socialMessenger/src/views/LoginView.mxml:3]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\co re\UIComponent.as:13128]
at mx.core::UIComponent/set processedDescriptors()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UIComponent .as:1871]
at mx.core::UIComponent/initializationComplete()[E:\dev\4.5.1\frameworks\projects\framework\ src\mx\core\UIComponent.as:7660]
at mx.core::UIComponent/initialize()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\ UIComponent.as:7639]
at spark.components::View/initialize()[E:\dev\4.5.1\frameworks\projects\mobilecomponents\src \spark\components\View.as:990]
at views::LoginView/initialize()
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.5.1\frameworks\projects\ framework\src\mx\core\UIComponent.as:7485]
at mx.core::UIComponent/addChildAt()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\ UIComponent.as:7189]
at spark.components::Group/addDisplayObjectToDisplayList()[E:\dev\4.5.1\frameworks\projects\ spark\src\spark\components\Group.as:2037]
at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()[E:\dev\4.5.1\frameworks\project s\spark\src\spark\components\Group.as:1628]
at spark.components::Group/addElementAt()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\c omponents\Group.as:1387]
at spark.components::Group/addElement()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\com ponents\Group.as:1345]
at spark.components::SkinnableContainer/addElement()[E:\dev\4.5.1\frameworks\projects\spark\ src\spark\components\SkinnableContainer.as:761]
at spark.components::ViewNavigator/createViewInstance()[E:\dev\4.5.1\frameworks\projects\mob ilecomponents\src\spark\components\ViewNavigator.as:1954]
at spark.components::ViewNavigator/commitNavigatorAction()[E:\dev\4.5.1\frameworks\projects\ mobilecomponents\src\spark\components\ViewNavigator.as:1867]
at spark.components::ViewNavigator/commitProperties()[E:\dev\4.5.1\frameworks\projects\mobil ecomponents\src\spark\components\ViewNavigator.as:1236]
at mx.core::UIComponent/validateProperties()[E:\dev\4.5.1\frameworks\projects\framework\src\ mx\core\UIComponent.as:8209]
at mx.managers::LayoutManager/validateProperties()[E:\dev\4.5.1\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:597]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:783]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1180]This is the error because the runtime does not find any way to call Java script that usally is called through External interface. So my guess is you are using a AIR project. U just need to download the latest swc http://code.google.com/p/facebook-actionscript-api/downloads/list for destop in your case and don't forget to but FBJSBridge.js to put in your source that will b used to help AS call Facebook API from AIR runtime
Hope it make some sense
Piyush Negi -
Oracle APEX versus Adobe Flex on AIR
Hi
I need advantages and disadvantages Oracle APEX versus Adobe Flex on AIR. I don't know Adobe and need your help. (we fight about our potential customer).
Project:
40 users insert own actvities into database. Supervisor analyse this info (reports, charts). Users connect to app via mobile phone EDGE using laptop.
RegardsHello again,
From the end-user perspective, FLEX applicatoins are more graphic in nature, in that they are truly graphic. APEX (at least through 3.2) generates a standard HTML type of web page. You can do graphics type of code, but Flex creates applications that will only run with Adobe tools. Flex generates an HTML page, but it calls a .swf file and plays that.
Unless it is critical that you have that fully graphic interface (a .swf file type of image that plays), standard HTML is much better. You can still generate graphs, charts and such; incorporate images in your page and all the things that standard web pages have.
With APEX, your users will see a standard HTML web-page type of interface, which most users today know how to use and expect.
Thanks,
Don.
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! :)
Maybe you are looking for
-
IPhone to Exchange calendar sync issues
OK, I have read through many posts on here, but have yet to find a post that describes my situation. If someone has seen this answered in other places, please let me know. I currently have the following setup: iPhone 2.2.1, using OTA sync with Exchan
-
OK , first of all, i am a newbie, and i have to admit, this question was posted already today under different subject line. It just shows, how desparately i need some help. The first time I've got one reply, but it's not helping so far, so here is th
-
Linking flash with an access database
can someone point me to a tutorial or sample file i can take apart... ive got my database done and im ready to link it up with my flash site.. i know i need to use a php or asp file to pass the info over... please help trey
-
Printing problem in cash journals
Hi Guru's While printing cash journals its comming earror like dis... For spilt postings: Repace RFCASH00 with RFCASH20 ( no variant) EVen i copy print paremeter from Standard one 0001. plz give me solution...... regards SS.
-
HT1414 where do you request that an iphone be unlocked?
I bought a second-hand iPhone 4 that is locked with a certain carrier that is not my regular carrier. I tried the easiest route: I plugged it into my Mac and opened iTunes... hoping for a miracle that didn't happen. What I got was a message suggestin