Dynamic chart dataproviders

It's very easy to definie charts in mxml, but in actionscript
I am wondering how I could define a dynamic, unbounded
arraycollection to be the dataprovider for a chart. For example, in
mxml you might have the code from below, but what if you don't know
at runtime, how many series you will have in your chart?
I could do something like this in a for loop:
genericChart.dataProvider = myData; // myData is a generic
ArrayCollection
// for loop start
var seriesList:ArrayCollection=new ArrayCollection();
var columnSeries:ColumnSeries = new ColumnSeries();
columnSeries.xField="point1"; // problem
columnSeries.yField="point2"; // problem
seriesList.addItem(columnSeries);
// for loop end, then assign series to chart
genericChart.series = seriesList.toArray();
but labeling the xField and yField are a problem since I
don't know the names of them in a dynamically created
Arraycollection. Any idea on how to make this work?

"Cr99" <[email protected]> wrote in message
news:gbiq92$c3e$[email protected]..
> It's very easy to definie charts in mxml, but in
actionscript I am
> wondering
> how I could define a dynamic, unbounded arraycollection
to be the
> dataprovider
> for a chart. For example, in mxml you might have the
code from below, but
> what
> if you don't know at runtime, how many series you will
have in your chart?
http://flexdiary.blogspot.com/2008/08/charting-example.html

Similar Messages

  • InDesign CS5 -- dynamic charting workflow?

    Hi,
    I searched the forum but I feel like I haven't quite found my answer.  Basically, my organization, in the past, has produced a dynamic 'demographic fact sheet' document for communities in the Denver, Colorado USA region. (example: http://www.drcog.org/communityprofiles/PDFs/ArapahoeCounty.pdf)  This was previously done with an Access database and a mail merge in Microsoft Publisher (I know, I know), but we would like to bring this process into CS5, since our graphic designers work in InDesign CS5 and would like to redesign the look and feel of this document while automating this workflow so that it isn't as time-consuming as manually copying and pasting charts for each community.
    What kind of workflow would most easily produce a document like this?  It is essentially a mixture of charts and graphs along with some dynamic text.  I've read about Data Merge and XML, but I'm not sure about the charting and graph part of this -- most of the information I've found online talks about using Illustrator to make dynamic charts, but I'm not quite sure how to put everything together.  Basically, I'd like the process to work like it did with Publisher and Access, if possible.  We basically set up a template and then based on the data, Publisher generated a document that showed the appropriate data  (and correct values in graphs/charts) for every community.  The graphic designers have the CS5 Design Premium package, so they do have access to Illustrator and other Adobe apps if these are necessary.
    The data is stored in an enterprise database now (not Access), so extracting it to a CSV or other type of format is not a problem.
    InDesign is not my area of expertise, but I want to help with the process as much as I can.
    Thank you so much for any insight or recommendations!
    Jonathan

    This type of project would be too data intensive for Indesign. ID's data merge and ID's xml capabilities would not be sufficient either. Not to say that Indesign could not be used to create content, but the data portion would have to be driven with a 3rd party solution, something like XMPie.This type of solution typically is postioned at the print end and ties all the components: content created from ID, variable image, variable text, data export file to create custom chart, etc. to produce a finished customized print piece.

  • CHART BUILDER ERROR WHEN TRYING TO GENERATE DYNAMIC CHARTS ON A JSP PAGE

    I'm working with J Develop 9.03 on Windows 2000 Professional Edition.
    I'm using the JSP demo files provided with Oracle Chart Builder to generate
    dynamic charts. The user specifies the query parameters, including the date
    range and the query results are returned by means of a line chart (with date on
    the x axis and values on the y axis).
    When trying to compile the project I get the following error messages:
    Error(165,2): class FileOutputStream not found in class _graph
    Error(170,5): class File not found in class _graph
    Error(176,4): exception java.io.IOException is never thrown in the
    corresponding try block
    I checked to see that the chartbuilder library (chartbuilder.jar) files are
    loaded into the project library. It's unusual that the class is not being
    found. I don't understand why. I developed my project using the following steps:
    1. Unzipped Chart Builder installation files into c:\Oraclechartbuilder
    2. Loaded chartbuilder class library
    c:\Oraclechartbuilder\chartbuilder\lib\chartbuilder.jar into J Developer class
    path (by selecting <Project Settings> <Paths> and browsing to the
    chartbuilder.jar file).
    3. Created a new JSP page in J Developer (graph.jsp)
    4. Copied JSP code syntax from the Word Pad demo file and pasted into graph.jsp
    5. Changed the DB connection parameters and static directory location on the
    JSP page.
    6. Compiled the project and received the above errors.
    I would like to know why the classes are not being found and how to fix the problem. Thanks, Jaafar

    Hi mshah101,
    This can happen if the applet is compiled using an higher version of java and the browser is pointing to an older version (even if minor version number is higher)

  • Dynamic charting in J2ME using SVG - based on SQL query from a web server

    Hi
    I am creating a J2ME application which needs to generate dynamic charts for the user.
    The data for generating the charts is stored on a web server. In order to have minimal computations on the mobile device, I want to generate the charts on the web server itself.
    I have written a code which generates svg (svg tiny) charts dynamically on a web server based on sql queries on a database . Now I want a J2ME client app to be able to retrieve this data through a web service.
    Can someone guide me as to how to return svg files from a java web service.
    Any help would be greatly appreciated.
    Regards
    Sparsh

    Hi
    Actually, I am developing my application using Netbeans 6. In order to connect to my web service , I am using the J2ME client to web service as the type of my project and that uses the above mentioned API's.
    My question is how do I enable my web service to return a SVG file , and then how do I retrieve it in the J2ME client. Any example application that anyone knows online would be really helpful

  • [DW + PHP + MySQL] is there an extension to create dynamic charts?

    Hi all
    is there an extension for DW (I have DW 8) that let you
    create dynamic
    chart based on a mysql database?
    Once upon a time there was an interakt extension that was
    created just
    for this kind of applications, but now it is discontinued
    (thanks
    adobe) and I can't even buy it.
    Is there an alternative?
    Thanks in advance.
    tony

    Check
    http://www.webassist.com. They
    have one.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "sweetman" <[email protected]> wrote in message
    news:[email protected]..
    > Hi all
    >
    > is there an extension for DW (I have DW 8) that let you
    create dynamic
    > chart based on a mysql database?
    >
    > Once upon a time there was an interakt extension that
    was created just
    > for this kind of applications, but now it is
    discontinued (thanks
    > adobe) and I can't even buy it.
    >
    > Is there an alternative?
    >
    > Thanks in advance.
    >
    > tony

  • Looking for the best dynamic chart utility

    Hi-
    I'm creating a piece of software which extensively uses dynamic charts. The charts I'm using need to be updated atleast twice a second with over 10000 points on them. I've tried using jfreechart but its just too slow. I'm running a 900mhz c3 processor w/ 256 megs of ram on slackware linux 9.1. Does anyone know of a faster dynamic chart utility?
    -thanks

    Just a thought.
    I make svg 'templates' holding all the static parts of the graph and then at run time add to the DOM for example at a polyline representing (x,y) data. Extremely light weight.
    This is also in preparation for sending DOMFrags across the net to update a dynamic part of a display running on a client.

  • Dynamic chart using SharePoint list data

    Is it possible to create dynamic chart from SharePoint List data using OOB.
    I have column Status [ choice - Pending , Submitted, Resolved ] . I want to genrate graph[Pie or Bar] show number of items in each status
    V Jean

    Thanks Lakshmanan,
    But in my environment - chart webpart is not available [ restricted].
    Have tried below using script.. Hope might help for other
    https://www.nothingbutsharepoint.com/sites/eusp/Pages/finally-dynamic-charting-in-wss-no-code-required.aspx
    V Jean

  • Create a number of Dynamic Charts based on "Work Centre" in BEx Workbook?

    Hi all,
    We are on BI 7.0
    I am trying to create a number of dynamic charts in a BEx workbook based on the different values of "Work Centre" so that each unique work centre has its own chart.
    All titles and descriptions would have to be dynamic based on the work centre.
    I.e If there are 20 work centres we would need 20 charts. 30 work centres 30 charts etc.
    Also to add a little more complexity we need to only show a chart if a key figure (Demand Hrs) has a value greater than ZERO.
    Would be very grateful and would assign generous points for a solution.
    This needs to be done in a BEx workbook.
    Thanks in advance,
    Steve Jones
    BI Consultant

    Hello,
    The only possible way you can have a work around is with help of VB macros.
    The logic would be simple: Have a VB Script to check the varying work centres from the report. Then for each work centre check for demand hrs greater than zero. Then you can go with a for or while loop to create the graphs as per needed.
    Take help of VB Script expert for this if needed. Also if you want to work around for yourself you can check the record marco functionality of the excel. VB Script Macro is your only way out and as in your case youu2019re using workbook, this satisfies your need.
    Regards,
    Shashank

  • Is it possible to add Dynamic Charts into Layout

    Hi all,
    I got a requirement to add dynamic charts when generating the PDF forms .
    The flow is a form is send by mail to a user.
    He populated it and send it back by mail to SAP .
    When SAP receive the mail, data is update in the backend and another forms have to be generat and send by mail.
    In the second form i need to create charts in order to have a more user friendly representation of data .
    I look everywhere but i do't find something to do it in background .
    Does somebody can help me ?
    Best regards

    Problem cancel

  • Changing dynamically chart in graphic Builder

    Is it possible to change chart dynamically in graphic builder?
    like pie chart into bar chart etc

    Dear Diana,
    unfortunately this is not possible.
    The chart title is build from the planning book name + the Show characteristic in the shuffler (+ available nav. attributes of the Show char).                                                           
    The functionality you requested doesn't exist in standard.            
    Regards,
    Tibor

  • Dynamic charts in Bex WAD

    Hi Experts.
    My requirements are as follows. I want to include max number of 5 charts in a template. At the moment I have 20 different chart queries (this number will grow) to choose between, chart web items are basically the same, only data provider is different.
    A query will tell me what charts (i.e. chart queries) that soul be included, and I only want to build those charts.
    It is not a good solution to include all the 20 +++ charts in the template and just unhide the ones I want to show as this will be too much administration as the number of charts grow.
    Are there no other way, like programming an API somewhere, like we can program the reporting table interface?
    Best regards,
    Nina

    You can use the parameter ITEM_ID to dynamically assign a chart id to the web item.
    A sample implementation can be seen in the 0ANALYZER template include for charts.
    Thanks.

  • Dynamic Chart values on a time line (like a ticker)

    Hello experts,
    can you give me a hint on how to implement a dynamic line chart (one whose values are to be updated every second via a Timer). The timeline is fixed. so the chart should start empty, fill up to the predefined range and then starts shifting the values to the left so that the new data can be appended....
    Any help is greatly appreciated.
    Best
    Holger

    Hi Holger,
    What you can do is use a TimedTrigger UI element.
    Assign a context(ctx_int) of type integer to its delay property with some initial value in the init() method.
    Assign an action to the onAction event and carry on your logic in this method and at the end of the method increment the value of the context ctx_int.
    Hope it helps
    Thanks
    Jeet

  • Can you integrate Crystal Reports dynamic charts onto DW?

    Is there a way that I can drag/drop or integrate dynamic/live
    charts that were built in Crystal Reports into Dreamweaver? I am
    designing the company website and would like to use Crystal to
    create our live graphs/charts and then integrate these charts into
    DW so people can see them on the site. These charts will be live
    and constantly updating so I'm not sure if this is possible...
    Has anyone tried this?
    Thanks!

    I haven't tried this. But wondering why you're not using
    Microsoft product such as Visual Studio or Visual Web Developer
    (free from web too from MS) to try this.
    I know Dreamweaver can't do ASP.NET 2.0 and above. So if
    you're going to be doing anything with C# or VB.NET I would look at
    Microsoft instead of DW.
    I know Crystal Reports work well with Visual Studio

  • How can I creat a dynamic chart legend?

    Will,I want to show multi hosts' dynamic CPU performance (the host ip can be changed).I use those code below for a test:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" backgroundColor="0xFFFFFF" initialize="init()">
         <mx:Script>
              <![CDATA[
                   import mx.charts.ChartItem;
                   import mx.charts.chartClasses.IAxis;
                   import mx.charts.chartClasses.LegendData;
                   import mx.charts.chartClasses.Series;
                   import mx.charts.events.ChartItemEvent;
                   import mx.charts.series.LineSeries;
                   import mx.collections.ArrayCollection;
                   import mx.containers.Canvas;
                   import mx.containers.HBox;
                   import mx.controls.Alert;
                   import mx.graphics.SolidColor;
                   [Bindable]
                   private var dayTimeV:int = 0;
                   [Bindable]
                   private var legendDP:ArrayCollection = new ArrayCollection();
                   //for record whether the ip changed by using the length
                   private var latestIp2Length:Object = new Object();
                   [Bindable]
                   public var statsPpg:ArrayCollection = new ArrayCollection([
                        new ArrayCollection([{dayTime:dayTimeV,CPU:24.0, IP:"100.0.2.0"}]),
                        new ArrayCollection([{dayTime:dayTimeV,CPU:27.6, IP:"100.0.2.1"}]),
                        new ArrayCollection([{dayTime:dayTimeV,CPU:35.4, IP:"100.0.2.2"}]),
                        new ArrayCollection([{dayTime:dayTimeV,CPU:31.6, IP:"100.0.2.4"}]),
                        new ArrayCollection([{dayTime:dayTimeV,CPU:28.3, IP:"100.0.1.6"}]),
                        new ArrayCollection([{dayTime:dayTimeV,CPU:27.2, IP:"100.0.1.9"}])
                   private function init():void{
                        latestIp2Length["100.0.2.0"] = 1;
                        latestIp2Length['100.0.2.1'] = 1;
                        latestIp2Length['100.0.2.2'] = 1;
                        latestIp2Length['100.0.2.4'] = 1;
                        latestIp2Length['100.0.1.6'] = 1;
                        latestIp2Length['100.0.1.9'] = 1;
                        initLegend();
                        createLineSeries();
                   private function createLineSeries():void{
                        for(var i:int = 0 ;i < statsPpg.length ;i++){
                        var lineSeries:LineSeries = new LineSeries();    
                        lineSeries.yField = "CPU";    
                        lineSeries.displayName = "CPU";
                        lineSeries.dataProvider = statsPpg[i];
                        lineSeries.id = "lineSeries"+i;
                        lineSeries.setStyle("adjustedRadius",2);
                        lineSeries.setStyle("radius",40);
                        lineSeries.setStyle("fill","#55CC33");
                        var series:Array = chartPPG.series;
                        series.push(lineSeries);
                        chartPPG.series = series;
                   //find the record using ip
                   private function indexOf(ip:String):int{
                        for(var i:int = 0 ; i < statsPpg.length ;i++){
                        if(statsPpg[i].getItemAt(0).IP == ip)
                             return i;
                        return -1;
                   private function modifyData():void{
                        dayTimeV++;
                        //all new added data
                        var forAdded:ArrayCollection = new ArrayCollection([
                             {dayTime:dayTimeV,CPU:24.0+Math.random()*10, IP:"100.0.2."+dayTimeV},
                             {dayTime:dayTimeV,CPU:27.6+Math.random()*10, IP:"100.0.2."+(dayTimeV+1)},
                             {dayTime:dayTimeV,CPU:35.4+Math.random()*10, IP:"100.0.2."+(dayTimeV+2)},
                             {dayTime:dayTimeV,CPU:31.6+Math.random()*10, IP:"100.0.2."+(dayTimeV+3)},
                             {dayTime:dayTimeV,CPU:28.3+Math.random()*10, IP:"100.0.1."+(dayTimeV+4)},
                             {dayTime:dayTimeV,CPU:27.2+Math.random()*10, IP:"100.0.1."+(dayTimeV+5)}
                        //the data(IP) appear at first time
                        var waitedForAdded:ArrayCollection = new ArrayCollection();
                        for(var i:int = 0 ; i < forAdded.length ;i++){
                             var index:int = indexOf(forAdded[i].IP);
                             if(index != -1){//if we found,append it
                                  statsPpg[index].addItem(forAdded[i]);
                             }else{//if not,
                                  waitedForAdded.addItem(forAdded[i]);
                   var j:int = 0;
                    for(i = 0 ; i < statsPpg.length ;i++){
                         // if length not changed,delete old data and add new
                         if(latestIp2Length[statsPpg[i][0].IP] == statsPpg[i].length){
                              delete latestIp2Length[statsPpg[i][0].IP];
                              var legendIndex:int = findLegendDPData(statsPpg[i][0].IP);
                              statsPpg[i].setItemAt(waitedForAdded[j],0);
                              latestIp2Length[waitedForAdded[j].IP] = statsPpg[i].length;
                              legendDP.setItemAt(newLegendData(waitedForAdded[j].IP),legendIndex);
                              j++;     
                         }else{//if length changed,the data appended already
                              latestIp2Length[statsPpg[i][0].IP] = statsPpg[i].length;
                   private function addData():void{
                        dayTimeV++;
                        newData();
                   private function newLegendData(ip:String):LegendData{
                        var legendData:LegendData = new LegendData();
                        legendData.label= ip;
                        legendData.marker= new HBox();
                        legendData.aspectRatio=1;
                        return legendData;
                   private function findLegendDPData(ip:String):int{
                        for(var i:int = 0;i < legendDP.length;i++){
                             if(legendDP[i].label == ip)
                                  return i;
                        return -1;
                   /* [Bindable]
                   public function get legend():ArrayCollection
                        var legend:ArrayCollection = new ArrayCollection();
                        for (var i:int = 0; i < statsPpg.length; i++)
                             var dataObject:Object = statsPpg[i][0];
                             legend.addItem(newLegendData(dataObject.IP.toString()));
                        return legend;
                   [Bindable]
                   public function set legend(legendData:ArrayCollection):void
                             legend = legendData;
                   private function initLegend():void
                        for (var i:int = 0; i < statsPpg.length; i++)
                             var dataObject:Object = statsPpg[i][0];
                             legendDP.addItem(newLegendData(dataObject.IP.toString()));
                   private function yAxisLabel(value:Object, previousValue:Object, axis:IAxis):String
                        return value + ' %';
              ]]>
         </mx:Script>
         <mx:Panel width="790" title="CPU.IP" layout="horizontal">
              <mx:LineChart  id="chartPPG" name="Comparison" showDataTips="true">
                   <mx:horizontalAxis>
                        <mx:CategoryAxis dataProvider="{statsPpg[0]}" categoryField="dayTime" title="Days" id="categories"/>
                   </mx:horizontalAxis>
                   <mx:verticalAxis>
                        <mx:LinearAxis labelFunction="{yAxisLabel}"  title="CPU" id="yAxis"/>
                   </mx:verticalAxis>
                   <!--<mx:series>
                        <mx:LineSeries id="CPU" yField="CPU" xField="dayTime" displayName="CPU  "/>
                        <mx:LineSeries id="IP" yField="IP" xField="IP" displayName="IP  " />
                   </mx:series>-->
              </mx:LineChart>
              <!--<mx:Legend dataProvider="{chartPPG}" markerWidth="50" markerHeight="4" legendItemClass="MyLegendItem" direction="vertical"  width="174"/>-->
              <!--<mx:Legend id="myActionScriptLegend" creationComplete="createDynamicLegend(event)" />-->
              <mx:Legend id="userLegend" dataProvider="{legendDP}"/>
              <mx:Button label="AddNewData" click="modifyData()"/>
         </mx:Panel>
    </mx:Application>
    the result is here:
    Question:
    1.I using the binding ArrayCollection  legendDP as the Legend's dataprovider, the Legend's showing not changed  when the legendDP changed
    2.How can I fill the Legend's color,the result has no color showed.

    Can anyone help?

  • Dynamic Charting question - On maximum rows and omiy label interval values

    Hi,
    I was wondering if it was possible to define a application variable and then reference it from within a Chart series definition.
    I frequenctly need to go in and exapnd the maximum number of rows for my chart series definitions to a value greater than
    15. And, if I have a Chart with multiple series it seems to make sense that they all have the same value. This made me think
    of trying to use some sort of variable. I tried using a hidden page item. However, Apex seemed to want a static numerical value
    and so I needed to just hard code the value for now. Has anyone had success with somethin else?
    Another issue I have is with the label display. When ploting time series data that allows the user to define a date range its hard
    to know up front how to set the Omit Label Interval. An ida solution would be to define a number of desired points that the chart
    can handle and dynamically assign omit interval based on some sort of formula. Again, the static value assignment makes sense for some
    date inputs and not so much for others.
    Thanks for any suggestions!

    Thanks for your reply.
    Not sure how to change the Chart Type to Custom XML
    For example, for one of my charts under Chart Settings the Chart Type is set as 2D Line.
    I don't see Custom XML as an option on that drop down.
    I do see some XML code under Region Definition | Source. Is that what you are referring to?
    Thanks!

Maybe you are looking for

  • Problem with my X7-00 display

    Hi guys, I have big problem with my X7-00 display... like it has been magnetized, but I'm not sure is that even possible. It is discolored, like on old CRT television displays. Any ideas?

  • Is it  possible to connect a servlet on WLS 6.1 to a server WLE 4.5?

    Hi all, Is it possible to connect a servlet java client on WLS 6.1 to a server CORBA on WLE 4.5? I have many problem, this connection doesn't! The configuration is ok! But when the client java call Tobj_Bootstrap bootstrap =                BootstrapF

  • I want to learn pro techniques like what you see on TV

    I want to be able to do the cool effects you see on modern documentaries like on the History channel or TLC with zoom blur transitions, slick retiming effects, complete with "swoosh" sound fx just to name a few techniques. I've tried looking up tutor

  • Old game on new mac

    Is there any way to play an old game (Traitors Gate) on my MacBook Pro. It's written for Mac OS 7.5. Are there any emulators out there? Or can I install OS 9 as a virtual machine (via Parallels or similar)? I have so many good adventure games that th

  • Locate wireless client by IP address ?

    Is there a easier way to locate a wireless client by ip addrss in a WISM controller or even via WCS ? I now go to the home page of my controller and go to the client section and filter by mac address , AP names, etc. once I find that, I  drill in and