Hi, thanks for your answer.

In fact, in the meantime, I've found a new way to do it.

Each time the timer launches the process, I add to the dataSet the value and
the date as a String.
-->  In the addData function:
dataSet.addItem( { xValue : xValue , nb: nb } );
xDate = new Date();
xValue =
String(xDate.getHours()+":"+xDate.getMinutes()+":"+xDate.getSeconds());

-->The new mx:LineChart
<mx:LineChart width="100%" height="100%"
        dataProvider="{dataSet}">
        <mx:series>
            <mx:LineSeries xField="xValue" yField="nb"
showDataEffect="{interp}" />
        </mx:series>
        <mx:horizontalAxis>
            <mx:CategoryAxis categoryField="xValue" id="xAxe"/>
        </mx:horizontalAxis>
        <mx:horizontalAxisRenderers>
           <mx:AxisRenderer labelRotation="45" axis="{xAxe}"/>
        </mx:horizontalAxisRenderers>

    </mx:LineChart>

Thanks for your help

So now, it works.



On Thu, Jan 8, 2009 at 5:34 PM, Amy <amyblankens...@bellsouth.net> wrote:

>   --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>,
> nerique <julien.balm...@...> wrote:
> >
> >
> > Hi,
> >
> > i'm recent to Flex 3, so maybe my question is easy to answer, or
> not, I
> > don't know :)
> >
> > I'm making a Real Time chart y using a Timer, and an HTTP Service.
> (Please
> > find attached a cleaned copy of my mxml:
> > http://www.nabble.com/file/p21349576/sample.mxml sample.mxml )
> >
> > Every 500 milliseconds, the Timer calls the HTTPService, which
> calls a PHP
> > distant file, which sends a value. This value is added to the Chart
> using
> > the addData function.
> >
> > My issue is the following: I'd like the Horizontal axis, to add a
> label
> > every minute (for example the chart is launched at 08:30, it shows
> first
> > 08:30, then 1 minute later, it adds 08:31 etc...) but I can't
> figure out how
> > to do this. I've tried to use a DateTimeAxis solution, but it
> doesn't seem
> > to be automatic.
> >
> > Could you help?
> >
> > Thanks!!!
>
> Have you tried changing the maximum property on the DateTimeAxis
> every minute?
>
>  
>



-- 
Julien Balmont
Project Manager
Tel:      +331 41 92 28 73
Mobile: +336 32 65 17 60

Echovox France
107 Avenue Charles de Gaulle
92200 Neuilly-Sur-Seine
France

Reply via email to