Problem in Line graph

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
             [Bindable]
            var xmlProducts:XMLList = graphList;       
     [Bindable]
     public var products:ArrayCollection = new ArrayCollection([
        {unit:"Radio", year:2007, quantity:5},
        {unit:"Radio", year:2008, quantity:7},
        {unit:"Radio", year:2009, quantity:10}
        ]]>
    </mx:Script>
    <mx:XMLList xmlns="" id="graphList">
        <record>
            <unit>Radio</unit>
            <year>2007</year>
            <quantity>5</quantity>
        </record>
        <record>
            <unit>Radio</unit>
            <year>2008</year>
            <quantity>7</quantity>
        </record>
        <record>
            <unit>Radio</unit>
            <year>2009</year>
            <quantity>10</quantity>
        </record>
    </mx:XMLList>
    <mx:LineChart x="386" y="23" id="unitChart" height="199" dataProvider="{products}" showDataTips="true">
        <mx:horizontalAxis>
            <mx:CategoryAxis dataProvider="{products}" categoryField="year" />
        </mx:horizontalAxis>
        <mx:series>
            <mx:LineSeries  yField="quantity"  displayName="Quantity" />
        </mx:series>
    </mx:LineChart>
    <mx:Legend dataProvider="{products}"/>
</mx:Application>
1- I have to draw a line chart for the products based on XMLList as dataprovider. In which horizontal axis is based on year values i.e 2007, 2008 , 2009. Vertical axis showing quantity for each unit data item Radio.
2- When i make a graph based on arraylist as data provider it works fine as in given example. but when i use xmlList as data provider it shows nothing. I think values in XMLList are all text but i don't know how to convert them to numeric.

Hi Asif,
You need to modify Your XmlList structure and you need to give XMLListCollection as a dataprovider to the LineGraph.
See the working sample below:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
     [Bindable]
     public var products:ArrayCollection = new ArrayCollection([
        {unit:"Radio", year:2007, quantity:5},
        {unit:"Radio", year:2008, quantity:7},
        {unit:"Radio", year:2009, quantity:10}
        ]]>
    </mx:Script>
    <!--<mx:XMLList xmlns="" id="graphList">
        <record>
            <unit>Radio</unit>
            <year>2007</year>
            <quantity>5</quantity>
        </record>
        <record>
            <unit>Radio</unit>
            <year>2008</year>
            <quantity>7</quantity>
        </record>
        <record>
            <unit>Radio</unit>
            <year>2009</year>
            <quantity>10</quantity>
        </record>
    </mx:XMLList>-->
    <mx:XMLListCollection id="graphList">
        <mx:source>
            <mx:XMLList>
                <record unit="Radio" year="2007" quantity="5" />
                <record unit="Radio" year="2008" quantity="7" />
                <record unit="Radio" year="2009" quantity="10" />               
            </mx:XMLList>
        </mx:source>
    </mx:XMLListCollection>
    <mx:LineChart x="386" y="23" id="unitChart" height="199" dataProvider="{graphList}" showDataTips="true">
        <mx:horizontalAxis>
            <mx:CategoryAxis categoryField="@year" title="Year"/>
        </mx:horizontalAxis>
        <mx:verticalAxis>
            <mx:LinearAxis baseAtZero="false" title="Quantity" />
        </mx:verticalAxis>
        <mx:series>
            <mx:LineSeries  yField="@quantity"  displayName="Quantity"/>
        </mx:series>
    </mx:LineChart>
    <mx:Legend dataProvider="{unitChart}"/>
</mx:Application>
If this post answers your question or helps, please kindly mark it as such.
Thanks,
Bhasker Chari

Similar Messages

  • CR XI - Problem Setting Line Graph colors in the Chart Expert

    Post Author: desselle
    CA Forum: Charts and Graphs
    Hello,
    I created a Crystal Report (CR) of an existing Trend Analysis report. I have created a VB6 application that calls the .RPT file I created for the report in CR.  The VB6 app sets the report recordset via code that corrsponds to the .TTX file, and the parameters .  The report contains a Line graph that plots five pieces of data.  The report & graph work good.  CR determines the color of each line on the graph.  However, I need to set the color for each line to correspond to the colors used on our existing reports.  The users are accustom to a certain color representing a certain set of data on the existing reports.   I have tried everything I can think of and from all documentation I can find, and nothing changes the line colors.   I have tried all of the following:
    1.) From the Chart Expert, Option tab, I click the Format button next to Color and setup conditional color settings per each piece of data.   However, when I run the report these conditional color settings are not reflected on the CR graph.     I am using formula fields (based off database fields in the recordset) to produce the report.  However, I only see the database fields to use in the conditional color formatting screen and not the formula fields.    I thought this would possibly be the cause why the colors wonu2019t change on the CR, but I canu2019t find a way to make the formula fields show up in the list.
    2.)Also, I tried right clicking the individual lines of the graph and change the selected item color, but this didnu2019t change the color either.  I do this in Design mode and Preview mode and neither one changes the color of the lines on the graph.
    3.)I have also looked into the CR object model to see if I can change the line colors of the graph via code and it doesn't look like I am given this flexibility.
    Do you know what I am doing wrong here?   I just want to be able to set the color of each line on the CR graph to the color I want instead of using the default colors.
    Thanks,Steve

    Post Author: desselle
    CA Forum: Charts and Graphs
    Hello,
    I got the problem fixed w/ the line graph not making the data lines the same color on the report as on the frmPlot graph.   Compare the two screen shots below.   The problem was as follows:  When I created the graph (in the Chart Expert) the field u201CReadingDateu201D was not one of the Report Fields, and all the other fields were Report Fields (Reading, LowAlarm, UpperAlarm, LowerLimit, & UpperLimit). See the 3rd screen shot below.  ReadingDate does show up as a Report Field now but it wasnu2019t at first.   Originally, this field was only available in the Chart Expert as a recordset field.  When I changed this field to be a Report Field, the graph then allowed me to change the data series line colors.   This was not obvious at all.   From the beginning when I setup the graph and passed in the recordset from VB it graphed all of the data series fine.   The colors that the Chart Expert chose for each line just didnu2019t match what was on the frmPlot graph.   Anyway, it is working now.     I can at least say I learned (somethingu2019s to-do and somethingu2019s not to-do) a good bit about Crystal Reports in the process.
    Thanks

  • Line Graph Problem when used with Series

    I am facing a problem with Line Graph in Oracle Reports 10g.
    I have made a graph having series of three curves.
    The graph is perfect when all series have similar X-Axis values. See the link
    http://www.sysautomation.com/ask/RPT_LINE_GRAPH_OK.PDF
    But same graph does not print curves properly, gives spaces in the curves, when all the series do not have similar values on X-Axis
    http://www.sysautomation.com/ask/RPT_LINE_GRAPH_NOT_OK.PDF
    Pl. guide me what to do to make this graph working.

    Thanks for reply.
    In my case, I have to plot curves.
    and some Series have different X-axis values.
    I have no choice, but to plot them.
    The same thing was working fine with Reports 6i + Graphics 6i.
    What is Scatter Plot?
    Thanks again.
    This is a limitation in the current line graph in
    Reports 10g (9.0.4). I can't recall whether this has
    improved in 10.1.2 or it was planned for the next
    rev.
    Would trying a scatter plot be better?
    Line graphs are normally meant for regular intervals
    on x-axis, so using the example of dates, Jan, Feb
    and Dec would be placed right next to each other,
    rather than scaled with the right distance between
    Feb and Dec.

  • Line graph parent table child

    i have a page where i have a line graph as parent and a table as its child. i want to have a master detail relationship through a view link of cardinality 1 to many.
    when user selects appropriate points of line graph, the child table should refresh accordingly.
    child table shows only children of firts record of line graph.
    is there a problem with line graph being a parent. i could find examples which used bar / pie graph but not line graph. although i had checked the checkbox while creating graph.
    i am using bind variables for both parent and child VO.
    do i need to execute child VO query again to be able to display corresponding children for a parent on a line graph.
    jdev 11 1 1 5

    Hi,
    when you create a line graph by dragging a collection (View Object) from the Data Controls panel to the page then, in the second dialog of the wizard, there is a check box "Set current row for master-detail". Check this check box and then create the table from the dependent view object. No bind variables required
    Frank

  • Problems with Flash Line Graphs

    I have two problems with the new Flash Line Graphs in APEX 3.1
    1. I have created a query that returns a set number of rows. Sometimes the VALUE for a specific row might be null. When this occurs the LABEL data does not show up on the X axis. I want the LABEL data to show up no matter what. How do I accomplish this?
    2. Related to the above query. When the VALUE field is null for 3 records (or more) in a row, not only does the LABEL data for those records not display, the VALUE and LABEL data for the records that appear in the set after these 3 records also do not display. If one or even two null VALUE fields appears in a row, things are still OK. What do I need to do to get all my data to display?
    Any help would be appreciated.
    THANKS
    Raymond

    Raymond,
    For the Interactive report chart issue, could it be related to this?
    Re: Apex 3.1. Interactive Report. Questions and Problems.
    Interactive Report. Chart. Seems to be bug...
    - Christina

  • Line Graph problem plz help :(

    Problem fixed
    Message was edited by:
    bm_za

    Thanks for reply.
    In my case, I have to plot curves.
    and some Series have different X-axis values.
    I have no choice, but to plot them.
    The same thing was working fine with Reports 6i + Graphics 6i.
    What is Scatter Plot?
    Thanks again.
    This is a limitation in the current line graph in
    Reports 10g (9.0.4). I can't recall whether this has
    improved in 10.1.2 or it was planned for the next
    rev.
    Would trying a scatter plot be better?
    Line graphs are normally meant for regular intervals
    on x-axis, so using the example of dates, Jan, Feb
    and Dec would be placed right next to each other,
    rather than scaled with the right distance between
    Feb and Dec.

  • Simple line graph problem

    Hi there,
    I want to create a very simple line graph, containing 1 line. Therefore i create a Graph.LINE_VERT_ABS type Graph and add the data using myGraph.setLocalRelationalData(al ArrayList). This arraylist contains values in the form of
    setname jan 12.2
    setname feb 14.5
    setname march 8.1
    etc
    When i do this, I get the errormessage: "The data has an insufficient number of columns. This graph type requires at least 2 columns of data. The data provided has one column.".
    When i add another dummy value to the arraylist:
    dummy dummya 1
    dummy dummyb 2
    the graph displays correctly, but only with a additional line for the dummy values, also in the Legend.
    What am i doing wrong. Surely it is possible to display just one line in the Graph??
    Any help is appreciated.
    Linda

    In the arraylist, setname identifies a column. By default, columns are plotted as groups, or different points along the horizontal axis. In order to have a line or area graph, you need two groups. The data that you are passing has 1 group and 3 series. You should pass it as follows:
    jan setname 12.2
    feb setname 14.5
    march setname 8.1
    etc.
    Passing data like this will give you three groups (jan, feb, march) and one series (setname).
    By the way, what version of BI Beans are you using and how did find out about setLocalRelationalData? That API was never publicly released. It was replaced by setTabularData (same method renamed) and exposed in 9.0.3.
    BI Beans Product Management

  • Problem in setting axis(x and y) in line graph

    Hi All,
    I have a database table student with two column score(number data type) and "no of student"(number data type). With this table I want a jsp line graph which will describe the student table.Score col would be in X axis and the other one in y axis.I am not able to set score in x axis. I am using JDeveloper 10.1.3.3.
    By using scatter graph I am able to set score in x axis and "no of student" in y axis.But my requirement is line graph.So, is there any way to achieve a line graph where score would be in x axis and "no of students" would be in y axis?
    Can any body help me regarding this matter?

    Hi,
    If you are still looking for the solution to this, you can change the graph to display the way you require.
    If you have a graph def file like BIGraphDef1.xml you need to select it in the application navigator. Then in the Structure window select the top level (ex. BIGraph1). This will give you the options available in the property inspector.
    If you change the dataRowShownAsASeries from True to False, you should be able to display your data in the line graph.
    Peter

  • Problem Plotting a Line Graph

    I am trying to plot some line graphs on Numbers and am a new user.
    I can't seem to work out an issue. I want the numbers on the X axis to ascend from 0 onwards from left to right but at the moment they are descending from 10 to 0 left to right.
    How can I change this so the graph is plotted logically?
    Thanks in advance

    There are two basic types of X-Y charts.  All but one are "category" charts where the X axis is evenly spaced and the "numbers" are actually text. The data will be presented in the order listed in your table.  The other is a scatter chart. The icon for this chart looks like a shotgun blast.
    If your X axis numbers are evenly spaced (0,1,2,3...) you can use either type of chart.  Sort your table in ascending order and it will chart as you want it to.
    If your X axis numbers are not evenly spaced (such as 1,2,4,5,10) and you want the chart to be a true X-Y plot of the data, you have to use the scatter chart.  In contrast to the category charts where the X axis values must be in a header column/row, a scatter chart requires the X and Y data to be in data cells. You may have to move your data over a column so the X data is not in a header column.

  • How do I change the line color in a line graph?

    I used Illustrator to create a line graph. (Not my desired option as I normally import them from R and then edit, but the textbook wanted to show that you can create graphs and edit them in Illustrator)
    Anyway, I did all of the editing except that I can't change the color of the line. My assignment requires me to match the textbook example and the textbook does not provide instructions on how to do it. I've done just about any method I can think of and the line still stays light gray. I'm almost willing to just give up and lose the points but something as simple as color can't be this hard, right? Right?

    Whenever I try to shift+direct select it thinks I want to move the line, so as I shift + direct select and drag my mouse across the line (to highlight it all) it moves a chunk of the line and turns it into a near perpendicular line.
    I found the appearance window, it just says "Path" (the color I want it to be that it's not)
    "Stroke" 4pt
    "Fill" (the color I want it to be that it's not)
    "Opacity": Default
    And some other buttons. I think I'll try the help line tomorrow, I know I saw a customer service number somewhere and I'm only here because the chat was unavailable. This is only one of my 3 problems with my assignment so I'll search here for answers to the other two. Learning new things is rarely fun.

  • 11.1.1.5 - Measure labels are appearing in legend (line graph)

    I've created a line graph in 11.1.1.5. My legend is showing a combination of the column value and the measure name (e.g. Web Sales, Direct Sales, Retail Sales). I want my legend to simply say Web, Direct, and Retail, without the appended 'Sales' measure label.
    The Measure Labels tile is currently residing in the Vary Color By (Horizontal Axis) zone, along with the legend column, so I guess it makes sense that the legend column and the measure labels would both show up in the legend (although I don't think that was the case in 11.1.1.3). However, there doesn't appear to be any place into which I can relocate the Measure Labels tile so that the word Sales DOESN'T appear on the line graph. If I move the Measures Labels tile into Graph Prompts, Sections, or Group By (Horizontal Axis), the word Sales appears in those locations. If I attempt to move that tile into the Lines (Vertical Axis) box, or into the Excluded box, it won't allow being dropped there.
    Switching between line, bar, and area graphs reveals the same problem in all graph types.
    Is there any way to supress the display of measure labels on graphs in 11.1.1.5?

    Hi Paul,
    This is the feature in 11g obiee displaying the Measue heading and dimension value... like u said right Web Sales...and so on.
    Here in u case web is the value of dimension and Sales is heading of a measure.
    One way is if u are not using any dimension apart from 1 dim and fact u can put measure labels in the group by axis and dimension column in the show in legend section then it will give u only web.
    But if u have 2 dimension then we have to put this measure labels with either one of the dimensions in this case heading of the measure wil display.
    Thanks
    Subhash

  • Marker Shape in Legend - Line Graph

    Hello,
    I have recently upgraded from 10g Release 1 to 10g Release 2.
    I am using a line graph. In Release 1, the data marker shapes show up in the legend. In Release 2, they don't. In Graph.xml, I have set the Graph element to have the attribute markerShapeInLegend="true".
    Does anybody else have this problem and/or know of a solution?
    Thank you.

    Hi Paul,
    This is the feature in 11g obiee displaying the Measue heading and dimension value... like u said right Web Sales...and so on.
    Here in u case web is the value of dimension and Sales is heading of a measure.
    One way is if u are not using any dimension apart from 1 dim and fact u can put measure labels in the group by axis and dimension column in the show in legend section then it will give u only web.
    But if u have 2 dimension then we have to put this measure labels with either one of the dimensions in this case heading of the measure wil display.
    Thanks
    Subhash

  • BI Publisher 11g. Plotting multiple lines in a line graph

    Hi,
    We have a requirment where we need to show multiple lines in a line graph. I have gone through the earlier posts for this topic but when I am following the same steps I am not able to resolve the problem.
    I have 3 mterics: Month (which will be X-axis) , Size (Which will be on y-axis) and Name. I have names for 10 tables and i want to display 10 lines in my line graph.
    In the chart generator, I am using Month in "Labels", Table name for "color" field" and size in the "values" section.
    When I am trying this I am geting the following error in chart generator. It says " The data required 2 columns. The data has only 1 column." To trick the system, I also put a dummy column with static value of 1, but then also i am getting the same error, that it requires 2 columns.
    the sample XML for the chart is like this:
    <G_2>
    <TABLE_SIZE_TRENDS>43.90832000000001</TABLE_SIZE_TRENDS>
    <TABLE_NAME>Table1</TABLE_NAME>
    <MONTH_NAME_TRENDS>April</MONTH_NAME_TRENDS>
    </G_2>
    - <G_2>
    <TABLE_SIZE_TRENDS>69.62872</TABLE_SIZE_TRENDS>
    <TABLE_NAME>Table2</TABLE_NAME>
    <MONTH_NAME_TRENDS>April</MONTH_NAME_TRENDS>
    </G_2>
    It looks pretty straightforward but I am stuck in it for quite some time now.
    All your guidance is greatly appreciated in this regard.
    Regards,
    Aakarsh

    any help? still need help. thanks

  • Creating a Double Line Graph

    Hello,
    I'm trying to create a graph from the information seen in the table below. I need to plot on the X- Axis, the T0,T1,T2 values. There will be two data sets for the line graph, Subject A and Subject B, the value from which will be plotted on the Y-Axis. I've spent about an hour now, trying to order the values to create the graph I need.
         Another way of saying this, is that I'm plotting the differences in Subject A versus Subject B over a period of Time (T0, T1, T2).
    It should look something like this:
    Help Please!
    -KB

    Hi KBaines,
    Please don't worry about wasting anyone's time. Many users in this forum look upon Numbers problems as a challenge. If you solved your own problem, please post your solution to help others.
    Regards,
    Ian.

  • Graphing a RUNNING TOTAL on a line graph

    So I'm having a lot of trouble putting my data on a chart. I have it all laid out here: files.me.com/redsteven1/glwk4v.numbers.zip
    Whenever I try to graph it though I run into a whole host of problems. Namely, that I can't get the values to plot on the chart at all.
    Not sure what the problem is... I select A2:G103... and I see the different series (for each Activity) show up in the legend, but nothing is plotted on the chart.
    I know that much of the table is blank... that's because I'll be adding to it every day.
    Ideally, the X-axis should be time/date.... May, June, July, and August can be the major tick marks. And the Y-axis would be number of hours spent on each activity.
    To further complicate things, the chart should really be a running total of time spent on each activity... so if I spend an hour on Activity 1 each day for 3 days... then on the third day I should have a plot of 3 hours... not 1.
    I know I didn't work things super well here... hopefully you can figure out what I mean by looking at the linked file : \
    Thanks in advance.

    I guess that line graph isn't the best one, I would use the Scatter one.
    You can't chart your datas as they are at this time.
    Every datas are date_time or duration values which can't be charted as is.
    Here, I converted the dates from column A into strings
    Then I added 6 columns in which I converted the durations into decimal hours.
    The original columns are hidden.
    The formula used to convert is a simple one.
    In H2, I inserted :     
    =STRIPDURATION(B)*24
    Fill to the right
    Fill Down
    to fill the other cells.
    Yvan KOENIG (VALLAURIS, France) dimanche 22 mai 2011 21:26:18
    Please :
    Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

Maybe you are looking for

  • 9iAS R2 Automatic Startup at Boot time on Windows

    How to successfully start the 9iAS R2 Application Server at boot time. Many of you are still struggling with the problem of 9iAS R2 not automatically starting up properly when your system is restarted. I've been fighting this issue for several weeks

  • Redownloading past Purchases

    When I try To Redownload 3 Songs From and Some Tv Shows From Cloud It's "This Computer Is Already Associated With Apole ID." "You Can Download Past Purchases On This Computer With Just One Apple ID every 90 Days. This Computer Can Be used With a Diff

  • Why SharePoint 2013 have only 2 level global navigation ??

    I just want to know why SharePoint 2013 have 2 levels of global navigation hierarchy by default. Is it possible to make it up to 3,4 levels. For example: Main Site -> Subsite -> Subsite Nodes -> Subsite Nodes Subsite -> Child Nodes & so on Something

  • Need some clarity on e-Commerce 5.0 for mySAP ERP

    Digging through the documentation I can find, I still can't make sufficient sense as to what, exactly, is required to get e-Commerce 5.0 for mySAP ERP up and running.  If we have an ECC 6.0 backend (ABAP stack only), what needs to be put into place? 

  • Column numbers in SQL Developer

    This may seem picky; but I find it frustrating to get error messages of the form error in line 35 column 83 and then not have a convenient way other than counting to find line 35 and column 83. Is there a way to jump to the error point? If not, is th