Programitically creating column series to flex chart not showing the chart

I want to create n number of series dynamically when i run my
application.
where n can be any value it depends on the data which i
retrieve from database. below i pasted the example
( in this example i have taken n = 4 i.e., CountMax=4 if i
change the CountMax=6 then it should generate 6series dynamically
after calculating the values. ). just copy the below code and paste
it in Flex builder and run the application.
in this example i am facing problem, chart series are not
showing. i dont know the reason why its not showing, if anyone got
the solutions for the problem please let me know. my actual
requirement is to retrieve data from Salesforce account and want to
populate the arraylist then display the chart.
<?xml version="1.0"?>
<!-- Example showing using mx:LineSeries vs using AS to
create chart series programmatically -->
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="drawChart()" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.charts.series.ColumnSeries;
import mx.charts.series.LineSeries;
import mx.collections.ArrayCollection;
[Bindable]
public var categoryArray:ArrayCollection = new
ArrayCollection();
[Bindable]
public var sArray:ArrayCollection = new ArrayCollection();
public function drawChart():void
var histMax:int = 25;
var histMin:int = 5;
var countMax:int = 6;
var tmpArr:Array = new Array();
categoryArray.removeAll();
for(var n:int = 0; n < 10; n++)
tmpArr[n] = histMin + Math.round((2 * n) / 20 * (histMax -
histMin));
categoryArray.addItem({data:tmpArr[n]});
// Add a series to the chart with the x-values and y-values
// from the arrays and set the series type to a column chart
for(var chartSeries:int = 0; chartSeries < countMax;
chartSeries++)
var tmpseries:Array = new Array(10);
for(var i:int = 1; i < 10; i++)
tmpseries = 3 * Math.random();
var cs:ColumnSeries = new ColumnSeries();
columnchart1.series.join( = [cs];
sArray.addItem({data:tmpseries});
//columnchart1.dataProvider = sArray;
cs = new ColumnSeries();
cs.dataProvider= sArray;
cs.displayName = 'Series';
cs.yField = 'data';
columnchart1.series[chartSeries] = cs;
]]>
</mx:Script>
<mx:Panel title="Dynamic Series Adding Sample"
width="195%" height="90%" layout="absolute">
<mx:ColumnChart id="columnchart1" height="338"
width="396" showDataTips="true" type="stacked" x="10" y="0">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{categoryArray}"
categoryField="data"/>
</mx:horizontalAxis>
<mx:verticalAxis>
<mx:LinearAxis baseAtZero="true" maximum="3"
autoAdjust="true"/>
</mx:verticalAxis>
</mx:ColumnChart>
</mx:Panel>
</mx:Application>

<?xml version="1.0"?>
<!-- Example showing using mx:ColumnSeries vs using AS to
create chart series programmatically -->
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="drawChart()" layout="absolute">
<mx:Script>
<![CDATA[
import mx.graphics.SolidColor;
import mx.charts.HitData;
import mx.controls.Alert;
import mx.charts.series.ColumnSeries;
import mx.charts.series.LineSeries;
import mx.collections.ArrayCollection;
[Bindable]
public var categoryArray:ArrayCollection = new
ArrayCollection();
public function drawChart():void
var histMax:int = 25;
var histMin:int = 5;
var countMax:int = 3;
var tmpArr:Array = new Array();
categoryArray.removeAll();
for(var n:int = 0; n < 10; n++)
tmpArr[n] = histMin + Math.round((2 * n) / 20 * (histMax -
histMin));
categoryArray.addItem({data:tmpArr[n]});
var cs:ColumnSeries = new ColumnSeries();
columnchart1.series = [cs];
// Add a series to the chart with the x-values and y-values
// from the arrays and set the series type to a column chart
for(var chartSeries:int = 0; chartSeries < countMax;
chartSeries++)
var tmpseries:Array = new Array(10);
for(var i:int = 0; i < 10; i++)
tmpseries
= 1 * Math.random();
if(tmpseries > 0.5)
tmpseries
= 1;
else
tmpseries = 0;
var testArrCol:ArrayCollection = new ArrayCollection();
for(var j:int =0; j < 10; j++)
var m:Number = tmpArr[j];
var m1:Number = tmpseries[j];
testArrCol.addItem({mData:m.toString(),nData:m1.toString()});
cs = new ColumnSeries();
cs.dataProvider = testArrCol;
cs.displayName = 'Series' + chartSeries;
cs.xField = 'mData';
cs.yField = 'nData';
columnchart1.series[chartSeries] = cs;
public function myTipFunction(hitData:HitData):String
return(ColumnSeries(hitData.element).displayName +" - "+
hitData.item.mData + "\n" + "Value : "+ hitData.item.nData);
]]>
</mx:Script>
<mx:Panel title="Dynamic Series Adding Sample" width="98%"
height="90%" layout="absolute">
<mx:ColumnChart id="columnchart1" height="338"
width="396" showDataTips="true" type="stacked" x="10" y="0"
dataTipFunction="{myTipFunction}">
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{categoryArray}"
categoryField="data"/>
</mx:horizontalAxis>
<mx:verticalAxisRenderer>
<mx:AxisRenderer visible="false"/>
</mx:verticalAxisRenderer>
</mx:ColumnChart>
</mx:Panel>
</mx:Application>

Similar Messages

  • Programitically adding column series in flex chart is not showing the chart

    <?xml version="1.0"?>
    <!-- Example showing using mx:LineSeries vs using AS to
    create chart series programmatically -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="drawChart()" layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.charts.series.ColumnSeries;
    import mx.charts.series.LineSeries;
    import mx.collections.ArrayCollection;
    [Bindable]
    public var categoryArray:ArrayCollection = new
    ArrayCollection();
    [Bindable]
    public var sArray:ArrayCollection = new ArrayCollection();
    public function drawChart():void
    var histMax:int = 25;
    var histMin:int = 5;
    var countMax:int = 6;
    var tmpArr:Array = new Array();
    categoryArray.removeAll();
    for(var n:int = 0; n < 10; n++)
    tmpArr[n] = histMin + Math.round((2 * n) / 20 * (histMax -
    histMin));
    categoryArray.addItem({data:tmpArr[n]});
    // Add a series to the chart with the x-values and y-values
    // from the arrays and set the series type to a column chart
    for(var chartSeries:int = 0; chartSeries < countMax;
    chartSeries++)
    var tmpseries:Array = new Array(10);
    for(var i:int = 1; i < 10; i++)
    tmpseries
    = 3 * Math.random();
    var cs:ColumnSeries = new ColumnSeries();
    columnchart1.series.join( = [cs];
    sArray.addItem({data:tmpseries});
    //columnchart1.dataProvider = sArray;
    cs = new ColumnSeries();
    cs.dataProvider= sArray;
    cs.displayName = 'Series';
    cs.yField = 'data';
    columnchart1.series[chartSeries] = cs;
    ]]>
    </mx:Script>
    <mx:Panel title="Dynamic Series Adding Sample"
    width="195%" height="90%" layout="absolute">
    <mx:ColumnChart id="columnchart1" height="338"
    width="396" showDataTips="true" type="stacked" x="10" y="0">
    <mx:horizontalAxis>
    <mx:CategoryAxis dataProvider="{categoryArray}"
    categoryField="data"/>
    </mx:horizontalAxis>
    <mx:verticalAxis>
    <mx:LinearAxis baseAtZero="true" maximum="3"
    autoAdjust="true"/>
    </mx:verticalAxis>
    </mx:ColumnChart>
    </mx:Panel>
    </mx:Application>

    <?xml version="1.0"?>
    <!-- Example showing using mx:ColumnSeries vs using AS to
    create chart series programmatically -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="drawChart()" layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.graphics.SolidColor;
    import mx.charts.HitData;
    import mx.controls.Alert;
    import mx.charts.series.ColumnSeries;
    import mx.charts.series.LineSeries;
    import mx.collections.ArrayCollection;
    [Bindable]
    public var categoryArray:ArrayCollection = new
    ArrayCollection();
    public function drawChart():void
    var histMax:int = 25;
    var histMin:int = 5;
    var countMax:int = 3;
    var tmpArr:Array = new Array();
    categoryArray.removeAll();
    for(var n:int = 0; n < 10; n++)
    tmpArr[n] = histMin + Math.round((2 * n) / 20 * (histMax -
    histMin));
    categoryArray.addItem({data:tmpArr[n]});
    var cs:ColumnSeries = new ColumnSeries();
    columnchart1.series = [cs];
    // Add a series to the chart with the x-values and y-values
    // from the arrays and set the series type to a column chart
    for(var chartSeries:int = 0; chartSeries < countMax;
    chartSeries++)
    var tmpseries:Array = new Array(10);
    for(var i:int = 0; i < 10; i++)
    tmpseries
    = 1 * Math.random();
    if(tmpseries > 0.5)
    tmpseries
    = 1;
    else
    tmpseries = 0;
    var testArrCol:ArrayCollection = new ArrayCollection();
    for(var j:int =0; j < 10; j++)
    var m:Number = tmpArr[j];
    var m1:Number = tmpseries[j];
    testArrCol.addItem({mData:m.toString(),nData:m1.toString()});
    cs = new ColumnSeries();
    cs.dataProvider = testArrCol;
    cs.displayName = 'Series' + chartSeries;
    cs.xField = 'mData';
    cs.yField = 'nData';
    columnchart1.series[chartSeries] = cs;
    public function myTipFunction(hitData:HitData):String
    return(ColumnSeries(hitData.element).displayName +" - "+
    hitData.item.mData + "\n" + "Value : "+ hitData.item.nData);
    ]]>
    </mx:Script>
    <mx:Panel title="Dynamic Series Adding Sample" width="98%"
    height="90%" layout="absolute">
    <mx:ColumnChart id="columnchart1" height="338"
    width="396" showDataTips="true" type="stacked" x="10" y="0"
    dataTipFunction="{myTipFunction}">
    <mx:horizontalAxis>
    <mx:CategoryAxis dataProvider="{categoryArray}"
    categoryField="data"/>
    </mx:horizontalAxis>
    <mx:verticalAxisRenderer>
    <mx:AxisRenderer visible="false"/>
    </mx:verticalAxisRenderer>
    </mx:ColumnChart>
    </mx:Panel>
    </mx:Application>

  • I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro D

    I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro DC has limitations. There is no way to define what points in columns to force break column? Nor create many columns that are useless? How does text to column in Excel, fixed size when we import text, and define where the breaks have columns?
    Google Tradutor para empresas:Google Toolkit de tradução para appsTradutor de sitesGlobal Market Finder
    Desativar tradução instantâneaSobre o Google TradutorCelularComunidadePrivacidade e TermosAjudaEnviar feedback

    PDF does not contain columns, rows, formats, styles, or other aspects of word processing or spreadsheet file formats.
    This is because PDF is decidedly not a word processing or spreadsheet file format or something "like" one of those.
    (see ISO 32000 for what PDF "is")
    What can optimize the export of PDF page content is to start with a well-formed tagged PDF (ISO 14289-1, PDF/UA-1 compliant).
    Without that export is what it is and one performs whatever content cleanup is needed using the native application for the export file (MS Word or Excel).
    Be well...

  • Workflow status column is not showing the internal status values (Inprogress, Started, Suspended, Completed)

    I've created SPD 2013 workflow and deployed them onto that document library, This workflow execute on item update event. When updating library item, workflow triggered and completed successfully but workflow status column is not
    showing the Internal Status values rather it is showing the Stage information. I've unchecked the "Automatically update stage name on workflow status" and republished the workflow. After that, it is still showing the stage information. Any help
    is really appreciated.

    Hi Venkadesh,
    It is by design that 2013 workflow will show stage name in the workflow status column when
    Automatically update the workflow status to the current stage name is checked.
    And the workflow status column will be blank when Automatically update the workflow status to the current stage name is unchecked.
    For existing workflows, the workflow status will still exists with the previous values after unchecking Automatically update the workflow status to the current stage name.
    We can use Set Workflow Status action to update the workflow status value based on our needs.
    Best regards,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Import option is not showing the Data Source created using ODBC

    Hi all,
    I'm new to OBIEE, just installed OBIEE 10g in my system with the help of some reply from this Forum (thanks to Kalyan for this).
    Now when I tried to create new rpd, the Import option is not showing the Data source I have created. I have created new Datasource in the SystemDSN tab of the ODBC Administrator window,I have tried this by creating the Datasource in the UserDNS tab as well.
    Mine is Windows 7 Ultimate. The new data source which I have created through the ODBC Administrator window is to connect to SQL 2008 (I'm trying to get some table from SQL 2008 database), I don't have Oracle data base.
    While creating the Data source ODBC Administrator is showing only two drives (SQL Server and SQL Server Native Client 10.0 ) , so I have created the Data source using the SQL Server Native Client 10.0 drive.
    Can some one help me to understand the issue and to solve it.
    Thanks,
    Mithun

    By calling your cellular data provider.

  • Times ten not showing the column alias as column header in select query.

    Hi All,
    I am trying to execute following queries on TimesTen database 11.2.2.2.0.
    SELECT ROWNUMBER,
    floor((to_date(TO_CHAR(SYSDATE,'YYYY-MM-DD hh24:mi:ss'), 'YYYY-MM-DD hh24:mi:ss')-to_date(TO_CHAR(starttime,'YYYY-MM-DD hh24:mi:ss'), 'YYYY-MM-DD hh24:mi:ss'))*24)
    || 'h '
    || mod(floor((to_date(TO_CHAR(SYSDATE,'YYYY-MM-DD hh24:mi:ss'), 'YYYY-MM-DD hh24:mi:ss')-to_date(TO_CHAR(starttime,'YYYY-MM-DD hh24:mi:ss'), 'YYYY-MM-DD hh24:mi:ss'))*24*60),60)
    || 'm '
    || mod(floor((to_date(TO_CHAR(SYSDATE,'YYYY-MM-DD hh24:mi:ss'), 'YYYY-MM-DD hh24:mi:ss')-to_date(TO_CHAR(starttime,'YYYY-MM-DD hh24:mi:ss'), 'YYYY-MM-DD hh24:mi:ss'))*24*60*60),60)
    || 's' TIME_DIFFERENCE
    FROM
    (SELECT ROW_NUMBER() OVER (ORDER BY USERIDENTITY DESC) ROWNUMBER,
    u.*
    FROM TBLMCORESESSIONS u
    WHERE 1=1
    ) B
    WHERE ROWNUMBER BETWEEN 1 AND 5
    and I am getting the follwing output.
    ROWNUMBER,
    < 1, 8h 52m 34s >
    < 2, 8h 54m 24s >
    < 3, 8h 54m 13s >
    < 4, 8h 55m 6s >
    < 5, 8h 54m 40s >
    The issue is I should get TIME_DIFFERENCE as column header but it is not showing TIME_DIFFERENCE as the column header & it is calculating the value just fine .
    & if same query I execute on oracle 11g database every thing works fine.
    please suggest me something that column header is must.
    or suggest me any other for query
    Edited by: hiaditya04 on Apr 24, 2012 11:05 AM

    Hi,
    It is similar to bug which is raised in Timesten 11.2.2.2.. BUG 13896607 - COLUMN NAME MISSING FROM A VIEW IN TIMESTEN 11.2.2.2 . If you have MOS access then you can view about this bug. The bug is going to be fix in the future release. The bug basically indicates that we are not displaying the column name properly when select list contains complex expressions. The column itself can be accessed and values are displayed correctly.
    Regarding your issue "column TIME_DIFFERENCE not found" , I would suggest you to access the column by position, not by name like below
    I believe you are trying to access your column like below
    resultset.getString(“TIME_DIFFERENCE”)
    Instead of this you can use : -- resultset.getString(2) ( this position should based on the position of the column you are using in the query)
    Hope this helps.
    Regards
    Rajesh

  • Not showing the column name

    Hi
    I am using jdev 11.1.1.3
    .i i dragged an adf table from data control.it has got 3 columns.i changed the name of first column as Lang grades.when i run that it is showing the column name as lang grades.then in that table two fields r mandatory.so in the property inspector i put the show required as true.but after that on running it is not showing the column name as lang grades.there is only the star sign for showing the attribute as required only.

    Hi,
    not enough information. So from your description, a column that is not marked required on its cell renderer component is not displayed at runtime. I am not aware of such a problem and suggest to try a later version of 11g R1 (11.1.1.6) to see if this reproduces. This allows you to exclude a probelm with 11.1.1.3 only
    Frank

  • HT1296 Calendar items created on my Iphone 4S are not showing up in the Calendar on my MacPro after USB Sync..  even though they are still on the phone... ideas???

    Calendar items created on my Iphone 4S are not showing up in the Calendar on my MacPro after USB Sync..  even though they are still on the phone... ideas???

    In the Event mode use the View ➙ Sort ➙ By Date ➙ Decending menu option.  Then the latest imports will be near the top of the Event window (depending on when the photos were taken of course). 
    Or Control-Click on one of the thumbnails in the Last Import album and select Show Event from the contextual menu:
    OT

  • Where are the bullets for adobe. im creating a document and they are not in the toolbar

    where are the bullets for adobe. im creating a document and they are not in the toolbar

    ADOBE PRO   I JUST GOT IT A FEW MONTHS AGO

  • In CS6 my created and then saved jpegs do not have the same icon as jpegs I receive from others. Whe

    In CS6 my created and then saved jpegs do not have the same icon as jpegs I receive from others. When attached to email they don't actually attach but appear embedded in the email and vertically squished. Any ideas?

    It could be as simple as having two different file extentions jpg vs jpeg. As for the emails, that may depend on how you are attaching them to the email.
    In most email programs you can open a new document then choose file attach or file import. Former would be attachments or links and the latter would be embedded.
    On windows systems you can also send images to the email app, in the explorer right clicking and sending would open a small app that will resize the image to reduce the file size. This app could in theory squish the image.

  • Automate Menu is not showing the option to create droplet in Photoshop cs3 windows 7

    Automate Menu is not showing the option to create droplet in Photoshop cs3 windows 7.  Any thoughts why?

    Have you reset the workspace to Default?
    Window>Workspace>Default Workspace

  • Upon launch of Lightroom after initial instalation a warning came up that said lightroom needs to create temporary files and cant open.  The it opened and the catalog i imported will not show the images.  How can I give permission? Running windows 8.1 64

    Upon launch of Lightroom after initial installation a warning came up that said lightroom needs to create temporary files and cant open.  Then it opened and the catalog i imported will not show the images.  How can I give permission? Running windows 8.1 64 bit.  I have avast virus software.

    Upon launch of Lightroom after initial installation a warning came up that said lightroom needs to create temporary files and cant open.  Then it opened and the catalog i imported will not show the images.  How can I give permission? Running windows 8.1 64 bit.  I have avast virus software.

  • HT4356 Up photos mart c7100 series wireless printer does not show up as a printer. Anyone found a fix for for use with ipad3?

    Up photos mart c7100 series wireless printer does not show up as a printer. Anyone found a fix for for use with ipad3?

    It sounds like the features are working through the USB connection rather than the wireless connection since it is still not seeing the networks.
    Everything points to a hardware failure since the steps provided through the private message did not work and the wireless test showed it had failed.  Sorry.
    You do have some options at this point.
    If it is under warranty, either standard or extended, you can contact HP support at 1-800-474-6836 to have it serviced under warranty.
    If it is out of warranty, you can still contact HP support to find out all the options and the cost of each option.  However, it is my opinion that this money would be better spend being applied towards a new printer. 
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • My iTunes is not showing the left column

    My iTunes is not showing the left column, it will NOT show the link to the music store or my playlists, and it is driving me crazy! PLEASE HELP ME!!

    How to restore your Preferences Dialog Boxes and/or your Source Pane:
    Scott P.: My Source List is missing (or, resetting the prefs)

  • Mac OS X Server v10.7 does not show the ethernet link aggregated interface I created in Server Hardware Network Dialogue window. Are link aggregated ethernet connections not supported in Lion Server?

    Mac OS X Server v10.7 does not show the ethernet link aggregated interface i created. Does Lion server support ethernet link aggregated interfaces?

    Thanks for responding Cold--
    Hardware: Mac Pro  3.0 GHZ quad core xeon
    I read the link but it still does not explain why the aggregated dual ethernet interface does not show up in the Network tab of the hardware section Lion Server. I was able to see it on the network and looks to be using a single static IP that I assigned. My concern was that is this supported and will it allow for failover and double performance of the single network interface.
    Any thoughts?
    Thanks again!

Maybe you are looking for

  • Error when opening iphoto library.

    when i try to open my iphoto library i get an error stating "The iphoto library is locked, on a locked disk, or you do not have permission to make changes to it." and it will not allow me to open the file.  The library is on a external hard disk and

  • Aix migration to windows

    I am a unix / solaris dba. My IT director wants to migrate to Windows based so they can hire more database operators familiar with windows. In my city there is a shortage of really good unix people. anyway , I was curious I think I am given more cont

  • Function Module to create Tasks in a Quality Notification

    Hi, I am trying to create Tasks in an existing Quality Notification through a program. I have used 'BAPI_QUALNOT_MODIFY_DATA', 'BAPI_QUALNOT_SAVE' and 'BAPI_TRANSACTION_COMMIT', but it create any tasks in the given quality notification. I am passing

  • Mail.app From and Subject are blank in list

    From time to time I get an email and once it is deleted, the "From" and "Subject" do not display in the list of emails. Its just blank. The "Date Received" shows up as well as if there were any attachments I get the paperclip icon, but no "From" or "

  • Migration of PO, GR, IR

    Hello friends, If we are going live, mid of the year, and we need to handle the migration of PO, what should be the strategy for differenet scenarios: 1) PO Created 2) PO Created with IR done and GR not done 3) PO Created with GR done and IR not done