LabelPosition and ColumnSeries on LineCharts

I have a LineChart with a Catergory axis and a number of LineSeries and a ColumnSeries.
When I try to set the labelPosition style of the columnSeies I get an error saying something like it cannot coerse my chart to a ColumnChart.
Is this a bug with Flex or is there actually a way of adding lables to my column on a LineChart ?
Andy Cooper

Hi,
         Set the interval for Horizontal axis with minInterval and Max Interval
<mx:LineChart id="chart" dataProvider="{arr}">
        <mx:series>
            <mx:LineSeries yField="Y" xField="X" >
            </mx:LineSeries>
        </mx:series>
        <mx:horizontalAxis>
            <mx:LinearAxis interval="2" minimum="0" maximum="40" />           
        </mx:horizontalAxis>
    </mx:LineChart>

Similar Messages

  • Mixing lineseries and columnseries in same chart

    I am trying to combine a lineseries and columnseries.  It works, but the columns are only 1 pixel wide which looks really ugly.  If I increase the stroke width, the columns use rounded corners which don't look right.  I would like to set the width to something like "percent of available space" so like 50% because the chart can be dragged and expanded and the columns should adjust to the overall width of the chart and have the columns draw like normal without rounded corners.
    Secondly, The line points are drawn in the middle of the columns.  I've tried setting the offest of the columns to -50 like it says in the documentation so that the columns are dran at the beginning of their available space, but this does nothing either.  I have to write this in Actionscript and here's some snippets of what I'm doing.
    var genericChart:CartesianChart = new CartesianChart() // I've tried LineChart and ColumnChart as well, nothing works
    var lineSeries:LineSeries = new LineSeries();
    stroke.weight = 3;   
    lineSeries.displayName = ser.name;
    lineSeries.setStyle("lineStroke", stroke1);  
    seriesArray.addItem(lineSeries);
    var columnSeries:ColumnSeries = new ColumnSeries();                              
    columnSeries.offset = -50;
    columnSeries.setStyle('stroke', stroke2);               
    columnSeries.setStyle("fill",stroke.color);
    seriesArray.addItem(columnSeries);
    genericChart.series = seriesArray.toArray()

    So, what camera do you "normally shoot in 720/60p (for slo-mo purposes)?"
    That would be an important factor to know. Interframe or intraframe?
    What sequence settings?
    How have you transcoded?
    Is this AVCHD?
    This is basic to learning how to respond?
    There are many cameras that shoot in a variety of formats, codecs, etc that are identical what you have stated.

  • LineChart Performance with createSymbols on

    I am using JavaFX 2.2 and creating a LineChart with lots of data points (8 series with 20K points each for a total of 60K data points). This works quite nicely if I setCreateSymbols(false). If I turn symbols on so that I can see the markers, it becomes unbearably slow. It appears that each symbol is represented by a Node which gives lots of flexibility and power, but upon profiling I see that I'm spending tons of time in the layout algorithms within JavaFX. Not too surprising considering the number of children nodes it's dealing with.
    Is there a way to have the LineChart just draw the markers as a path (as it does for the line itself) rather than create 10s of thousands of Nodes? Has anyone done this themselves? That is, leave setCreateSymbols(false) but draw markers on top of the chart?
    Any tips or tricks to get the symbols without the performance hit would be greatly appreciated.
    ---- Update ---
    After finding the OpenJDK source code for LineChart, it seemed fairly straightforward to accomplish what I wanted. I tried a simple experiment by creating my own subclass of LineChart with one overridden method: layoutPlotChildren. It seems to be the only place where the path line associated with each series is created. As an experiment I had my overriden method start by calling super.layoutPlotChildren(). then, for each series in the line chart, it enumerated the data points an added a small box around it. See code below. The result displays correctly but runs even more slowly than the version with Nodes for each symbol. Based on Profiler output, all the time is spent in the rendering engine's ScanlineIterator.
        @Override protected void layoutPlotChildren() {
            super.layoutPlotChildren();
            for (int seriesIndex=0; seriesIndex < getData().size(); seriesIndex++) {
                Series<X,Y> series = getData().get(seriesIndex);
                if(series.getNode() instanceof  Path) {
                    Path seriesLine = (Path)series.getNode();
                    for (Data<X,Y> item : series.getData()) {
                        double x = getXAxis().getDisplayPosition(item.getXValue());
                        double y = getYAxis().getDisplayPosition(
                                getYAxis().toRealValue(getYAxis().toNumericValue(item.getYValue())));
                        ObservableList<PathElement> pathElements = seriesLine.getElements();
                        pathElements.add(new MoveTo(x-1, y-1));
                        pathElements.add(new LineTo(x+1, y-1));
                        pathElements.add(new LineTo(x+1, y+1));
                        pathElements.add(new LineTo(x-1, y+1));
                        pathElements.add(new LineTo(x-1, y-1));

    Hi David,
    I would not expect you to see much change in overall performance. Likely start up will be a touch longer, but if you leave Aperture loaded then that will be a non-issue. Theoretically you should have some performance degradation, but much of Aperture's latency appears due to graphics capability, lack of RAM and much less to disk I/O.
    That said, I'm assuming the two drives are the same speed. If the primary drive is slower that could result in some (potentially minor) difference.
    If your library is not too large, and you are not using referenced, then merely copying the library across (or even export/import a project into a new empty library) will verify.
    G.

  • Timing a HTTPService

    Hi,
    I had an earlier post where I am displaying multiple charts
    on an Accordian. I have it set up to make an HTTP Service call on
    the "change" event, and now I'd like to have it make a service call
    so that it automatically updates the data every minute or so.
    My current code is below (it contains other poeple's code for
    this forum too):
    <mx:Script>
    <![CDATA[
    import mx.events.*;
    import mx.rpc.events.*;
    [Bindable] public var chartdata:ArrayCollection;
    [Bindable] private var newchartdata:ArrayCollection;
    private function getMoreData():void
    pSrv.send();
    [Bindable]
    public var onedaytime:Array = ["12
    am","","","","","","","","","9 am", "","","12 pm","","2
    pm","","","5 pm","","","","9 pm","","",""];
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    public function ShortTimer() :void
    var minuteTimer:Timer = new Timer(10000);
    // designates listeners for the interval and completion
    event
    minuteTimer.addEventListener(TimerEvent.TIMER_COMPLETE,
    onTimerComplete);
    // starts the timer ticking
    minuteTimer.start();
    public function onTimerComplete(evt:TimerEvent):void
    pSrv.send();
    pSrv2.send();
    ]]>
    </mx:Script>
    And in the accordian I have:
    <mx:Accordion x="0" y="0" creationComplete="pSrv.send();"
    width="100%" height="100%"
    change="getMoreData()" headerHeight="50"
    themeColor="#80ffff" fontSize="17" color="#000000"
    cornerRadius="0">
    And in the LineChart I have:
    <mx:Canvas label="Office Temperature Data" fontSize="4"
    width="100%" height="100%" cornerRadius="0">
    <mx:Panel x="0" y="0" width="100%" height="100%"
    layout="absolute" borderStyle="none">
    <mx:LineChart id="T_OFFICE"
    creationComplete="ShortTimer()" width="100%" height="100%"
    dataProvider="{pSrv.lastResult.data.point}" showDataTips="true"
    fontFamily="Verdana" fontSize="12" >
    To me, this should work - is there something I'm not getting
    here? I want to chart to continuously tick along as it gets more
    data.
    Thanks to all who can help!

    Hi THanks for the help,
    I looed at an earlier forum post and simplified it a bit to
    suit my needs. For all the noobies like me out there I will post it
    below:
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="init()"
    >
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import flash.utils.setInterval;
    private var timer:Timer;
    [Bindable] private var currentTime:String;
    private function init():void
    timer = new Timer(10000);
    timer.addEventListener(TimerEvent.TIMER, sendData);
    timer.start();
    private function sendData(evt:TimerEvent):void
    pSrv.send();
    pSrv2.send();

  • LineChart and -fx-text-fill issue: how do I change the color of the labels

    Hello everyone,
    I'm currently facing an issue when I'm trying to style my LineChart with some CSS. Indeed I would like to change the color of the labels of my xAxis (CategoryAxis) and yAxis (NumberAxis) but it's not working.
    In my FXML file I tried to use the style attribute on my LineChart tag using: <LineChart style="-fx-text-fill: white"> with no result, the text remains black (even for the title of my chart). In order to know if the style attribute is well parsed I changed it to: style="-fx-background-color: red; -fx-text-fill: white;". The background is becoming red but the text still remains black.
    Finally I tried to define a stylesheet in my controller class with the same properties (red background and white text). My stylesheet is this one:
    .chart {
        -fx-text-fill: white;
        -fx-background-color: red;
    }In my controller I do the following line in order to load my CSS file:
    this.chart.getStylesheets().add(getClass().getResource("statistics-style.css").toExternalForm());Even with this option the text remains white, while the background becomes red.
    What I also tried is to put the -fx-text-file CSS property directly on my axises, but again it seems it is ignored.
    I followed the steps described in Figure 8-2 of this site: http://docs.oracle.com/javafx/2/charts/css-styles.htm
    Does anybody have an idea or encountered this issue?
    Thank you very much,
    Thierry.
    PS: I'm using JFX 2.1 on MacOS X
    Edited by: twasyl on May 8, 2012 7:57 AM
    Edited by: twasyl on May 8, 2012 7:59 AM

    Hi,
    I figured a solution out to solve my problem. Currently in the documentation it is said to redefine the .chart CSS class in order to change the color of the title and labels text. But this is not working. Strangely the following code changes the font-size of both title and labels but ignores the -fx-text-fill property:
    .chart {
      -fx-font-size: 20pt;
      -fx-text-fill: white;
    }In order to change the color of the title I override the .chart-title CSS class:
    .chart-title {
      -fx-text-fill: white;
    }And for the labels:
    .axis-label {
      -fx-text-fill: white;
    }Well I don't know if there still is a bug on the .chart CSS class or maybe that behavior is expected.

  • Schedule type LineChart with clients and unavailable start and end dates

    I have been working on trying to get something in flex which will display a list of clients and their unavailability start and end dates.   I have attempted the line chart and the HLOC chart but have not seen success.  I do have the H or V grids working fine.  But getting the data to display in a line graph based upon start date and end date has been my challenge.  any suggestions
    Current Code:
        <s:Label x="0" y="5" text="Min Date" height="24" fontFamily="Times New Roman" verticalAlign="middle"/>
        <mx:DateField id="minDateField"
                      x="50" y="5"
                      formatString="MM-DD-YYYY"
                      selectedDate="{minDate}"
                      change="minDatefield_changeHandler(event)"/>
        <s:Label x="150"  y="5" text="Max Date" height="24" fontFamily="Times New Roman" verticalAlign="middle"/>
        <mx:DateField id="maxDateField"
                      x="200" y="5"
                      formatString="MM-DD-YYYY"
                      selectedDate="{maxDate}"
                      change="maxDatefield_changeHandler(event)"/>
        <mx:LineChart id="nonAvailsLC" x="0" y="40"
                      showDataTips="true"
                      dataProvider="{getNonAvailsResult.lastResult}"
                      creationComplete="nonAvailsLC_creationCompleteHandler(event)"
                      width="890" height="550">
            <mx:backgroundElements>
                <mx:GridLines gridDirection="both"/>
            </mx:backgroundElements>
            <mx:horizontalAxis>
                <mx:DateTimeAxis dataUnits="days" minimum="{minDate}" maximum="{maxDate}"
                                 labelUnits="days"/>
            </mx:horizontalAxis>       
            <mx:verticalAxis>
                <mx:CategoryAxis categoryField="user" labelFunction="getName"/>
            </mx:verticalAxis>       
            <mx:series>
                <mx:LineSeries xField="startDate" yField="user"
                               form="horizontal"/>
            </mx:series>
        </mx:LineChart>

    I guess I still have lots to learn about Flex and Renderers. I downloaded a Gantt chart with Code and they used the AdvancedDataGrid with renderers and such.  I modified the code to work for me. but if I had to create it myself right now, I would be in trouble.  Lots more to learn.

  • LineChart with current and historical data daily report

    Hi all,
    I'm new on BAM and I want to know if it is possible to define a LineChart showing information about today and the 30 last days.
    Is it possible using two dataobjects, one for today data and an external one provided by ODI with the contents for the last 30 days?
    Anyone can provide a sample?
    Thanks in advance.

    Hi,
    Both current and historical data are always stored within the same table. There is no option to create separate tables for each that are managed by OWM.
    However, you do have the option to use dbms_wm.PurgeTable which can be used to purge a set of data, and optionally store it in a archive table. But, after that is done the data is no longer under Workspace manager's control or the versioning environment. From the description that you gave, I am unsure if this would be sufficient to satisfy your requirements. I am guessing not, but wanted to make you aware of the functionality.
    Regards,
    Ben

  • LineChart with unknown amount and name of elements

    Hi!
    I want to create a LineChart. This charts displays a changing
    number over a period of time.
    <?xml version="1.0" encoding="utf-8"?>
    <root>
    <poll>
    <id>1</id>
    <answerIDs>
    <id>a1</id>
    <id>a2</id>
    </answerIDs>
    <resultsByDate>
    <entry date="03/01/2007">
    <1><results>15</results></1>
    <2><results>18</results></2>
    </entry>
    <entry date="03/02/2007">
    <1><results>25</results></1>
    <2><results>8</results></2>
    </entry>
    <entry date="03/03/2007">
    <1><results>45</results></1>
    <2><results>38</results></2>
    </entry>
    </resultsByDate>
    </poll>
    </root>
    <mx:LineChart id="chart"
    dataProvider="{service.lastResult.root.poll.resultsByDate.entry}"
    >
    <mx:horizontalAxis>
    <mx:CategoryAxis categoryField="date" />
    </mx:horizontalAxis>
    <mx:horizontalAxisRenderer>
    <mx:AxisRenderer labelRotation="45" />
    </mx:horizontalAxisRenderer>
    <mx:series>
    <mx:LineSeries displayName="1" xField="date"
    yField="results" />
    <mx:LineSeries displayName="2" xField="date"
    yField="results" />
    </mx:series>
    </mx:LineChart>
    It only works when I don't use <results> in the XML and
    set the yField to "1" or "2".
    Later In the application I don't know the amount and name of
    the elements (1,2,44,4564, ..), so I will use AS for that:
    var ls:LineSeries = new LineSeries();
    chart.series = [ls]; // associate the array
    var answers:Array = ["1", "2"];
    for (var i:uint = 0; i < 2; i++)
    trace(i);
    ls = new LineSeries();
    ls.displayName = answers
    .toString()
    ls.xField = 'date';
    ls.yField = 'results';
    chart.series = ls;
    This code works, but only without 'results'.
    Maybe can someone help me? I sit not possible to have nested
    objects as provider for xField and yField?

    By using a temporary table instead of a permanent.SET @query =
    'SELECT * INTO #NewPivotTable
    FROM
    SELECT productId,_year,amount
    FROM Products
    )t
    PIVOT (SUM(amount) FOR _year
    IN ('+@years+')) AS pvt; SELECT * FROM #NewPivotTable '
    EXECUTE (@query)
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to call and use xml data on UI LineChart using HTTPservice

    i want to make the LineChart component in the UI to get xml Array data from an URL (as example: http://localhost/ECG/Array) and view the data as a waveform. can anybody help me with this ??

    If you are saying that your XML is stored in a table, I'm not sure there is any method, using DAL or rule, that would know how to load XML from there. I can be wrong, but I think it has to load the XML from disk only - either as the extract file or as an external file referenced from the extract - using a Rule or DAL to go after the external file.
    Perhaps you could clarify the situation a little more and someone might offer a suggestion.

  • Populate datagrid and draw linechart based on xmlList

    I am generating dynamic xml structure like this
    <root>
      <OPVector>
        <Distance>0</Distance>
        <Height1>100</Height1>
        <Height2>200</Height2>
        <Height3>300</Height3>
      </OPVector>
      <OPVector>
        <Distance>100</Distance>
        <Height1>200</Height1>
        <Height2>300</Height2>
        <Height3>400</Height3>
      </OPVector>
      <OPVector>
        <Distance>200</Distance>
        <Height1>300</Height1>
        <Height2>400</Height2>
        <Height3>500</Height3>
      </OPVector>
    </root>
    What i have to do is to populate data grid based on this xml structure and draw a line chart where distance is category axis (x-axis) and Height1, Height2 etc are line series . No of Height fields depends on how many height values are entered by user (in text field Height1, Height2, Height3, Height4, Height5,Height6).
    Given is the code of my application ....
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="905" height="482" creationComplete="init();">
    <mx:Script>
    <![CDATA[
    import mx.events.IndexChangedEvent;
    private var dataProvider:XMLList = new XMLList();
    private var initDist:int ;
    private var offset:int  ;
    private var finalDist:int;
    private var height1:int;
    private var height2:int;
    private var height3:int;
    private var height4:int;
    private var height5:int;
    private var height6:int;
    private var heat:int;
    private var dataOP:XMLList;
    public function init():void{
    initDist = parseInt(txtInitDist.text);
    offset = parseInt(txtOffset.text);
    finalDist = parseInt(txtFinalDist.text);
    height2 = parseInt(txtHeight1.text);
    height2 = parseInt(txtHeight2.text);
    height3 = parseInt(txtHeight3.text);
    height4 = parseInt(txtHeight4.text);
    height5 = parseInt(txtHeight5.text);
    height6 = parseInt(txtHeight6.text);
    heat = parseInt(txtHeat.text);
    public function getOP():void{
    dataOP = createXMLObject();
    currentState='stateOP';
    trace(dataOP.toXMLString());
    } // public function getOP():void{
    public function createXMLObject():XMLList{
    var data:XMLList = XMLList(<root></root>);
    for (var i:int=initDist;i<=finalDist;i+=offset){
    var x:XMLList = new XMLList(<OPVector></OPVector>);
    var distance:String = "<Distance>"+i+"</Distance>";
    var strHeight1:String = "<Height1>"+(parseInt(txtHeight1.text)+i)+"</Height1>";
    var strHeight2:String = "<Height2>"+(parseInt(txtHeight2.text)+i)+"</Height2>";
    var strHeight3:String = "<Height3>"+(parseInt(txtHeight3.text)+i)+"</Height3>";
    var strHeight4:String = "<Height4>"+(parseInt(txtHeight4.text)+i)+"</Height4>";
    var strHeight5:String = "<Height5>"+(parseInt(txtHeight5.text)+i)+"</Height5>";
    var strHeight6:String = "<Height6>"+(parseInt(txtHeight6.text)+i)+"</Height6>";
    x.appendChild(distance);
    if (txtHeight1.text != ""){
    x.appendChild(strHeight1);
    if (txtHeight2.text != ""){
    x.appendChild(strHeight2);
    if (txtHeight3.text != ""){
    x.appendChild(strHeight3);
    if (txtHeight4.text != ""){
    x.appendChild(strHeight4);
    if (txtHeight5.text != ""){
    x.appendChild(strHeight5);
    if (txtHeight6.text != ""){
    x.appendChild(strHeight6);
    data.appendChild(x);
    } // for (var i:int=initDist;i<finalDist;i+=offset){
    return data;
    } // public function createXMLObject():void
    ]]>
    </mx:Script>
    <!-- States Definition -->
    <mx:states>
    <mx:State name="stateOP">
    <mx:RemoveChild target="{btnOP}"/>
    <mx:RemoveChild target="{btnThermal}"/>
    <mx:RemoveChild target="{txtHeight5}"/>
    <mx:RemoveChild target="{txtHeight6}"/>
    <mx:RemoveChild target="{txtFinalDist}"/>
    <mx:RemoveChild target="{label1}"/>
    <mx:RemoveChild target="{label2}"/>
    <mx:RemoveChild target="{label3}"/>
    <mx:RemoveChild target="{txtHeight3}"/>
    <mx:RemoveChild target="{txtHeight4}"/>
    <mx:RemoveChild target="{txtOffset}"/>
    <mx:RemoveChild target="{label4}"/>
    <mx:RemoveChild target="{label5}"/>
    <mx:RemoveChild target="{label6}"/>
    <mx:RemoveChild target="{txtHeight1}"/>
    <mx:RemoveChild target="{txtHeight2}"/>
    <mx:RemoveChild target="{txtInitDist}"/>
    <mx:RemoveChild target="{label7}"/>
    <mx:RemoveChild target="{label8}"/>
    <mx:RemoveChild target="{label9}"/>
    <mx:RemoveChild target="{txtHeat}"/>
    <mx:RemoveChild target="{label13}"/>
    <mx:AddChild position="lastChild">
    <mx:DataGrid x="57" y="112" width="274" height="336" id="dgPressure" dataProvider="{dataOP}">
    <mx:columns>
    <mx:DataGridColumn headerText="Column 1" dataField="col1"/>
    <mx:DataGridColumn headerText="Column 2" dataField="col2"/>
    <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:LineChart x="382" y="112" id="lcOverPressure" width="513" height="182">
    <mx:series>
    <mx:LineSeries displayName="Series 1" yField=""/>
    </mx:series>
    </mx:LineChart>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:Legend dataProvider="{lcOverPressure}" x="810" y="51"/>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:Button x="382" y="426" label="Close" id="btnClose" click="currentState=''"/>
    </mx:AddChild>
    </mx:State>
    <mx:State name="stateTR">
    <mx:RemoveChild target="{txtHeat}"/>
    <mx:RemoveChild target="{txtHeight1}"/>
    <mx:RemoveChild target="{txtHeight3}"/>
    <mx:RemoveChild target="{txtHeight5}"/>
    <mx:RemoveChild target="{txtHeight2}"/>
    <mx:RemoveChild target="{txtHeight4}"/>
    <mx:RemoveChild target="{txtHeight6}"/>
    <mx:RemoveChild target="{txtInitDist}"/>
    <mx:RemoveChild target="{txtOffset}"/>
    <mx:RemoveChild target="{txtFinalDist}"/>
    <mx:RemoveChild target="{label13}"/>
    <mx:RemoveChild target="{label7}"/>
    <mx:RemoveChild target="{label4}"/>
    <mx:RemoveChild target="{label3}"/>
    <mx:RemoveChild target="{label8}"/>
    <mx:RemoveChild target="{label5}"/>
    <mx:RemoveChild target="{label1}"/>
    <mx:RemoveChild target="{label9}"/>
    <mx:RemoveChild target="{label6}"/>
    <mx:RemoveChild target="{label2}"/>
    <mx:RemoveChild target="{btnOP}"/>
    <mx:RemoveChild target="{btnThermal}"/>
    <mx:AddChild position="lastChild">
    <mx:DataGrid x="39" y="108" width="301" height="364">
    <mx:columns>
    <mx:DataGridColumn headerText="Column 1" dataField="col1"/>
    <mx:DataGridColumn headerText="Column 2" dataField="col2"/>
    <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:LineChart x="420" y="108" id="linechart1" width="475" height="181">
    <mx:series>
    <mx:LineSeries displayName="Series 1" yField=""/>
    </mx:series>
    </mx:LineChart>
    </mx:AddChild>
    <mx:AddChild position="lastChild">
    <mx:Legend dataProvider="{linechart1}" x="810" y="13"/>
    </mx:AddChild>
    </mx:State>
    </mx:states>
    <!-- States Definition -->
    <!-- Controls Definition -->
    <mx:TextInput x="331" y="95" width="62" id="txtHeat" text="8"/>
    <mx:TextInput x="231" y="229" width="62" id="txtHeight1" text="100"/>
    <mx:TextInput x="231" y="259" width="62" id="txtHeight3" text="300"/>
    <mx:TextInput x="231" y="289" width="62" id="txtHeight5"/>
    <mx:TextInput x="357" y="229" width="62" id="txtHeight2" text="200"/>
    <mx:TextInput x="357" y="259" width="62" id="txtHeight4"/>
    <mx:TextInput x="357" y="289" width="62" id="txtHeight6"/>
    <mx:TextInput x="580" y="229" width="62" id="txtInitDist" text="0"/>
    <mx:TextInput x="580" y="259" width="62" id="txtOffset" text="100"/>
    <mx:TextInput x="580" y="289" width="62" id="txtFinalDist" text="2000"/>
    <mx:Label x="298" y="97" text="Heat" id="label13"/>
    <mx:Label x="168" y="231" text="Height1" id="label7"/>
    <mx:Label x="168" y="261" text="Height3" id="label4"/>
    <mx:Label x="168" y="291" text="Height5" id="label3"/>
    <mx:Label x="302.5" y="231" text="Height2" id="label8"/>
    <mx:Label x="301" y="261" text="Height4" id="label5"/>
    <mx:Label x="301" y="291" text="Height6" id="label1"/>
    <mx:Label x="484" y="231" text="Initial Distance" id="label9"/>
    <mx:Label x="533" y="261" text="Offset" id="label6"/>
    <mx:Label x="490" y="291" text="Final Distance" id="label2"/>
    <mx:Button x="298.5" y="384" label="Pressure Effects" id="btnOP" click="getOP()"/>
    <mx:Button x="464.5" y="384" label="Thermal Effects" width="142" id="btnThermal"/>
    <mx:Label x="298" y="10" text="Weather Effects" fontWeight="bold" fontSize="18"/>
    <!-- Controls Definition -->
    </mx:Application>

    I suggest that you first not try to cram all of your code into the MXML. Though many examples use this approach for quick copy-and-pasting, it is bad style and not as maintainable. You should use the code-behind approach where your MXML is strictly for layout of the view and its root element is a custom class that extendeds the usual base (in this case Application).
    Since the number of series in your line cart may vary, what you will need to do is dynamically create them whenever the data provider is updated.

  • Two problems : areaChart along with Line and double y-axis in LineChart

    Hi Friends,
    This forum is very useful as we are getting lots of help from people who are trying out this new technology and giving/using help to/from others.I am developing a real time application in JavaFx in which I need to implement Charts using dynamic data coming from a server.
    Now I am facing two types of problem which may be interrelated in some way.
    Problem 1 :
    I need to combine an areachart along with a line Chart.There is nothing in JavaFx like area-line Chart so should i go with all area charts and make the fill-color of area series transparent(is it possible to have transparent fill in area-chart ? by css ?) OR i should stack two charts one area and one line on top of one another making the background of either transparent(once again is it possible to have transparent background for a chart so that background chart/series is visible ?) OR any other suggestion ? Anyways I tried stacking using stackPane and it turned out to be ugly combination of misaligned charts :-(
    Problem 2 :
    I need to put two y-axis(i.e secondary axis) on the same chart but i am unable to find such feature with my best efforts.I know I can set the side of Axis using setSide method of Axis class but how can i put it both side simultaneously.Also is there a way to put different scales on these axis ? I mean is it possible to have two different series with drastic difference in bounds(data range) to be put on same chart by attaching them to different Y-axis on the same chart ?

    I don't think there is anything in the JavaFX library which matches exactly what you need.
    You might be able to use some tips from the 3d pie chart I created at: https://gist.github.com/1485144. This demonstrates stacking multiple charts on top of each other, whilst removing rendundant details so it doesn't end up a jumbled mess and looking up items by their css tags and modifying them.
    There is now excellent documentation on chart css at http://docs.oracle.com/javafx/2.0/charts/css-styles.htm#CIHGIAGE. If this doesn't get you all of the css hooks you need to dig out the details required from the chart, then you can unpack jfxrt.jar and search for caspian.css or you can recursively print the nodes in the chart which will tell you the type and style of each node. Armed with this information you could should then be able to stack the two charts you created on top of each other, align them correctly and strip away the info you don't need. To get the second y axis to the other side of the chart you could look it up by css in code, then do a translateX on it to so that it is translated by a bind to the width of the x axis. Seems doable, if a little fiddly.
    You might be tempted to directly create an Axis yourself by creating an instance of http://docs.oracle.com/javafx/2.0/api/javafx/scene/chart/NumberAxis.html and laying it over your chart, but I was unable to get that to work (http://javafx-jira.kenai.com/browse/RT-18270) - even if you did so, you would have to manually set up the ranges and ticks as the chart library wouldn't handle that for you. Another way to create a Axis like thing is by creating a http://docs.oracle.com/javafx/2.0/api/javafx/scene/control/Slider.html, disabling user input on it and removing it's thumb via css.
    My efforts at answering chart questions in the past sometimes ended up as "That's not what I need": Re: How to create PieChart like this?
    Questions about charts are hard to answer without a link to an exact image of what the required chart is expected to look like.

  • LineChart with two X-axis

    Hello!
    How can I implement the LineChart component to have two X-axis like in the screenshot attached?
    Note: The Y axis is the same for both line charts, not inverted or anything.
    Thank you!

    here is a code where it shows 2 y axis just alter this to x axis and do the needful
    <?xml version="1.0"?>
    <!-- charts/MultipleAxes.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script><![CDATA[
         import mx.collections.ArrayCollection;
         [Bindable]
          public var SMITH:ArrayCollection = new ArrayCollection([
            {date:"22-Aug-05", close:41.87},
            {date:"23-Aug-05", close:45.74},
            {date:"24-Aug-05", close:42.77},
            {date:"25-Aug-05", close:48.06},
         [Bindable]
          public var DECKER:ArrayCollection = new ArrayCollection([
            {date:"22-Aug-05", close:157.59},
            {date:"23-Aug-05", close:160.3},
            {date:"24-Aug-05", close:150.71},
            {date:"25-Aug-05", close:156.88},
      ]]></mx:Script> 
      <mx:Panel title="Column Chart With Multiple Axes">
         <mx:ColumnChart id="myChart" showDataTips="true">
            <mx:horizontalAxis>
               <mx:CategoryAxis id="h1" categoryField="date"/>
            </mx:horizontalAxis> 
            <mx:horizontalAxisRenderers>
                <mx:AxisRenderer placement="bottom" axis="{h1}"/>
            </mx:horizontalAxisRenderers> 
            <mx:verticalAxisRenderers>
                <mx:AxisRenderer placement="left" axis="{v1}"/>
                <mx:AxisRenderer placement="left" axis="{v2}"/>
            </mx:verticalAxisRenderers> 
            <mx:series>
               <mx:ColumnSeries id="cs1"
                    horizontalAxis="{h1}"
                    dataProvider="{SMITH}"
                    yField="close"
                    displayName="SMITH"
                >
                    <mx:verticalAxis>
                       <mx:LinearAxis id="v1" minimum="40" maximum="50"/>
                    </mx:verticalAxis>          
               </mx:ColumnSeries>          
               <mx:LineSeries id="cs2"
                    horizontalAxis="{h1}"
                    dataProvider="{DECKER}"
                    yField="close"
                    displayName="DECKER"
                >
                    <mx:verticalAxis>
                        <mx:LinearAxis id="v2" minimum="150" maximum="170"/>          
                    </mx:verticalAxis>
               </mx:LineSeries>
            </mx:series>
         </mx:ColumnChart>
         <mx:Legend dataProvider="{myChart}"/>
      </mx:Panel>
    </mx:Application>

  • Problem formatting date labels with DateTimeAxis and parseFunction

    I'm working with a line chart that gets its data from a MySQL
    database and
    I'm using a DateTimeAxis to try to display the date on the
    x-axis. The date
    is formatted in the database as "YYYY-MM-DD" - however when I
    run the
    application I am only seeing the date displayed as MM/YY. I
    am using a
    parseFunction as follows:
    public function myParseFunction(s:String):Date {
    var a:Array = s.split("-");
    var newDate:Date = new Date(a[0],a[1]-1,a[2]);
    return newDate;
    I was trying to experiment with setting dataUnits to days or
    weeks but it
    doesn't seem to change. Can anyone figure out what I'm doing
    wrong?
    Thanks,
    -Dan
    The code for the line chart is:
    <mx:LineChart x="10" id="linechartHist"
    dataProvider="{dataProvider1}"
    showDataTips="true" width="100%" height="100%" y="10">
    <mx:horizontalAxis>
    <mx:DateTimeAxis displayName="Date" title="Date (Month)"
    parseFunction="myParseFunction" dataUnits="days"/>
    </mx:horizontalAxis>
    <mx:horizontalAxisRenderer>
    <mx:AxisRenderer canDropLabels="true"/>
    </mx:horizontalAxisRenderer>
    <mx:verticalAxis>
    <mx:LinearAxis title="Price" id="vAxis"
    labelFunction="vLongLabels"
    interval="10"/>
    </mx:verticalAxis>
    <mx:series>
    <mx:LineSeries displayName="MSFT" yField="MSFT"
    xField="date"/>
    <mx:LineSeries displayName="PG" yField="PG"
    xField="date"/>
    <mx:LineSeries displayName="NTDOY" yField="NTDOY"
    xField="date"/>
    </mx:series>
    </mx:LineChart>

    Hi
    Try using "sv_SE" locale.

  • How to draw and copy a line?

    I would like to draw a line in a XYLineChart and then copy this line, in order to get this result
    [http://s14.postimage.org/4cip47ult/A02519.png]
    First left mouse click on point 1, then second mouse click on point 2: my goal is to have now a copy (clone) of this line (same lenght, same slope) that I can place anywhere on the chart, in this example by a third left mouse click on point 3.
    How to do this?
    Here is the code to draw a line on the chart
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.chart.CategoryAxis;
    import javafx.scene.chart.LineChart;
    import javafx.scene.chart.NumberAxis;
    import javafx.scene.chart.XYChart;
    import javafx.scene.control.Label;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.Pane;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Line;
    import javafx.scene.shape.LineTo;
    import javafx.scene.shape.MoveTo;
    import javafx.scene.shape.Path;
    import javafx.stage.Stage;
    public class Lines extends Application {
    Path path;
    public static void main(String[] args) {
        launch(args);
    @Override
    public void start(Stage stage) {
        final CategoryAxis xAxis = new CategoryAxis();
        final NumberAxis yAxis = new NumberAxis(0.5, 9.5, 0.1);
        yAxis.setTickUnit(1);
        //yAxis.setPrefWidth(35);
        yAxis.setMinorTickCount(10);
        yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis) {
            @Override
            public String toString(Number object) {
                String label;
                label = String.format("%7.2f", object.floatValue());
                return label;
        final LineChart<String, Number> lineChart = new LineChart<String, Number>(xAxis, yAxis);
        lineChart.setCreateSymbols(false);
        lineChart.setAlternativeRowFillVisible(false);
        lineChart.setLegendVisible(false);
        XYChart.Series series1 = new XYChart.Series();
        series1.getData().add(new XYChart.Data("Jan", 1));
        series1.getData().add(new XYChart.Data("Feb", 4.5));
        series1.getData().add(new XYChart.Data("Mar", 2.5));
        series1.getData().add(new XYChart.Data("Apr", 6.5));
        series1.getData().add(new XYChart.Data("May", 4.5));
        series1.getData().add(new XYChart.Data("Jun", 8.5));
        series1.getData().add(new XYChart.Data("Jul", 6.5));
        BorderPane bp = new BorderPane();
        bp.setCenter(lineChart);
        Scene scene = new Scene(bp, 800, 600);
        lineChart.setAnimated(false);
        lineChart.getData().addAll(series1);
        Lines.MouseHandler mh = new Lines.MouseHandler( bp );
        bp.setOnMouseClicked( mh );
        bp.setOnMouseMoved( mh );
        stage.setScene(scene);
        path = new Path();
        path.setStrokeWidth(1);
        path.setStroke(Color.BLACK);
        scene.setOnMouseDragged(mh);
        scene.setOnMousePressed(mh);
        bp.getChildren().add(path);
        stage.setScene(scene);
        stage.show();
    class MouseHandler implements EventHandler< MouseEvent > {
    private boolean gotFirst    = false;
    private Line    line;
    private Pane    pane;
    private double  x1, y1, x2, y2;
    public MouseHandler( Pane pane ) {
        this.pane = pane;
    @Override
    public void handle( MouseEvent event ) {
        if( event.getEventType() == MouseEvent.MOUSE_CLICKED ) {
            if( !gotFirst ) {
                x1 = x2 = event.getX();
                y1 = y2 = event.getY();
                line = new Line( x1, y1, x2, y2 );
                pane.getChildren().add( line );
                gotFirst = true;
            else {
                line = null;
                gotFirst = false;
            else {
                if( line != null ) {
                    x2 = event.getX();
                    y2 = event.getY();
                    // update line
                    line.setEndX( x2 );
                    line.setEndY( y2 );
      }Thanks all.
    Edited by: 932518 on 16-nov-2012 1.54

    Sorry for the simplistic question - but where are the photos you are intending to add going to be coming from?
    If it is the pictures you take - then it almost seems like you need to first upload them to a cloud service like OneDrive or iCloud and then provide the URL to Google Maps

  • How to skip null ColumnSeries values in a clustered ColumnChart?

    (this is a simple but difficult problem; call-out to clever chart-coders):
    When displaying multiple ColumnSeries in a clustered ColumnChart (3.5 SDK), the default behavior is to allocate a blank space when one of the series has no value in the dataprovider.  Below is a simple example (slightly modified from the base example of ColumnCharts in the help docs): when it comes to "Feb", it shows the values for Profit and Expenses, but also leaves a blank space for "VaryingOccurence".  This only happens when the Chart type is clustered (the default).
    This may seem like nitpicking, but in my context I have about 12 different series, many of which do not occur for each category value - so each of my category values has a whole lot of empty space between the clustered columns.  I just want to tell the Chart, "don't allocate any space for the chartItem in the series if its null" (or even 'if it's zero' would be fine): i.e., "ColumnSeries.showNullValues=false" - but that doesn't exist.
    Overriding updateDisplayList (to draw nothing) in a custom itemRenderer for the series does not work: the chart still allocates space for the row.  I'm thinking there's got to be someplace in ColumnChart where it's allocating space for the series (referring to properties like columnWidthRatio), but I can't find where to tell it "don't bother if the chartItem is null".
    If this is impossible to achieve via subclassing the Chart or the Series, does anyone have any creative ideas to acheive the end-result? To reiterate, the goal would be to show the result of the code below, but without the empty space for the null value in Feb.
    thanks,
    -Ped
    <?xml version="1.0"?>
    <!-- charts/BasicColumn.mxml --><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script><![CDATA[
         import mx.collections.ArrayCollection;
         [Bindable]
         public var expenses:ArrayCollection = new ArrayCollection([
            {Month:"Jan", Profit:2000, VaryingOccurence:1750, Expenses:1500},
            {Month:"Feb", Profit:1000, Expenses:200},                                         //no instance of VaryingOccurence
            {Month:"Mar", Profit:1500, VaryingOccurence:750, Expenses:500}
      ]]></mx:Script>
      <mx:Panel title="Column Chart">
         <mx:ColumnChart id="myChart" dataProvider="{expenses}" showDataTips="true" type="clustered" >
            <mx:horizontalAxis>
               <mx:CategoryAxis categoryField="Month" />
            </mx:horizontalAxis>
            <mx:series>
               <mx:ColumnSeries yField="Profit" displayName="Profit" />
               <mx:ColumnSeries yField="VaryingOccurence" displayName="Varying Occurence" />
               <mx:ColumnSeries yField="Expenses" displayName="Expenses"  />
            </mx:series>
         </mx:ColumnChart>
         <mx:Legend dataProvider="{myChart}"/>
      </mx:Panel>
    </mx:Application>

    I have the data in this fashion.see the image in the below link.
    http://img13.imageshack.us/img13/5189/deviationreport.jpg
    Column Deviation(sec) contains --> +ve as well as -ve values.
    in order to plot two charts on this report (one showing +ve values and one showing -ve values) i have created two columns
    +ve deviation and -ve deviation.
    f{x} of the calculated columns are given above.
    Now plz suggest how the is not null filter will work and on what column.

Maybe you are looking for

  • Timer, Threads, TableModels, and adding a row. Need Help

    Ok so essentially my problem is i guess pretty simple. Skip this next part to get to the problem. My project: I'm simply building a bell server, pretty simple. Plays a sound/recording at a specific time. It also however, grabs the times off an RSS fe

  • Where is groove templates in Logic 9

    I've looked under options as I used to do in Logic 8 but it seems to have completely disappeared in Logic 9. Jason

  • Can't move tabs in FF 22.0 or emails in TB 17.07.

    For reasons I can not determine I am no longer able to drag and drop tabs in firefox or drag emails from my inbox to another folder in Thunderbird. I have restarted both, I have tried safemode with no success. This behavior started about 5 days ago (

  • Report Script

    I have a substitution variable in report script for current week. Trying to add two more columns with the two prior weeks. Is there a command for that?

  • Training videos for learning actionscript 3

    Does anyone know of any good video training series that teaches, in depth and is very thorough on learning everything there is to know about Actionscript 3?