Loading ...
Sorry, an error occurred while loading the content.

Astra Line chart

Expand Messages
  • lucio
    Hello all i am struggling to get two series implemented on an line chart, i would like to know If anyone has any examples with click events that would return
    Message 1 of 3 , Sep 1, 2008
    • 0 Attachment
      Hello all i am struggling to get two series implemented on an line
      chart, i would like to know If anyone has any examples with click
      events that would return me the values of the points on mouse click
    • tripp.bridges
      ... Hi, The financial timeline example on http://developer.yahoo.com/flash/astra-flash/charts/examples.html is a good example of a line chart with multiple
      Message 2 of 3 , Sep 2, 2008
      • 0 Attachment
        --- In ydn-flash@yahoogroups.com, "lucio" <cor_sibu@...> wrote:
        >
        > Hello all i am struggling to get two series implemented on an line
        > chart, i would like to know If anyone has any examples with click
        > events that would return me the values of the points on mouse click
        >

        Hi,
        The financial timeline example on
        http://developer.yahoo.com/flash/astra-flash/charts/examples.html is a
        good example of a line chart with multiple series. Below, I'll
        document the steps you would take to add an event listener to retrieve
        the points of the mouse click using the ChartEvent. All of the changes
        will be made in FinancialTimeline.as.

        First, import the ChartEvent:
        import com.yahoo.astra.fl.charts.events.ChartEvent;

        Next, at the end of the code block in the xmlLoadCompleteHandler
        method, add an event listener:
        this.chart.addEventListener(ChartEvent.ITEM_CLICK, chartItemClickHandler);

        Finally, you will create an event handler
        private function chartItemClickHandler(event:ChartEvent):void
        {
        //This would give you the x and y coordinates in relation to the
        entire chart
        trace("mouse x = " + this.chart.mouseX);
        trace("mouse y = " + this.chart.mouseY);

        //This would give you the x and y coordinates in relation to the
        plottable area
        var marker:Sprite = event.itemRenderer as Sprite;
        trace("plottable x = " + (marker.x + marker.mouseX));
        trace("plottable y = " + (marker.y + marker.mouseY));

        //This would give you the x and y coordinates of the marker in
        relation to the plottable area.
        trace("marker x = " + marker.x);
        trace("marker y = " + marker.y);
        }

        Thanks,
        Tripp
      • lucio
        Man you re a god you came when i wanted to give up and create a chart from scratch , you know how much time you saved me ? thanks aloT !!! luciano
        Message 3 of 3 , Sep 2, 2008
        • 0 Attachment
          Man you're a god you came when i wanted to give up and create a chart
          from scratch , you know how much time you saved me ? thanks aloT !!!

          luciano
        Your message has been successfully submitted and would be delivered to recipients shortly.