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

Re: [ydn-javascript] YUI Charts initialization issue

Expand Messages
  • Dwight Bridges
    The chart does draw immediately when it is initialized. It will then redraw when it receives data. Normally this is unnoticeable but in some cases, as yours,
    Message 1 of 2 , Jun 29, 2009
    • 0 Attachment
      Re: [ydn-javascript] YUI Charts initialization issue The chart does draw immediately when it is initialized. It will then redraw when it receives data. Normally this is unnoticeable but in some cases, as yours, you will see the initial renderering. You can feel free to file a bug/feature request at yuilibrary.com. There are a couple of options that you can try to resolve the issue. You can load your initial data with the page instead of using the xhr. This should eliminate the delay and the redraw issue. You can then use xhr data source to repopulate data in the chart when necessary. If you need to use xhr for your initial data, you can try to call the DataSource's sendRequest method and initialize the chart in the callback function of your datasource. This way the chart will not draw until the data is ready.

      Tripp


      On 6/29/09 12:58 PM, "matt_3251091" <sommer.matt@...> wrote:


        

        

      Hello there.  I'm having an issue when creating a chart using an XHRDataSource (the issue goes away when I test with a local test data file).. the issue is that my chart draws with a set of [what appears to be] default axis values ($0-$1 in this case of the Y), and this axis pops to the correct axis (for example, $50-$60) based on my CurrencyAxis function once the data and line on the chart is loaded.  The delay is at most a quarter to half a second, but it creates a blank chart with small values on the Y axis that then are replaced with the correct values.  This happens for the X axis too (date range goes from 12:00) to the correct range.  So, im wondering if there is a way to not have the chart render until everything is formated correctly and in the correct range, the pop from one axis values to the other is very unattractive.  I'm creating the whole chart at once using the example methods: ---thanks!
       var mychart = new YAHOO.widget.LineChart("chart", jsonData,
       {    
       series: seriesDef,
       style: styleDef,
       xField: "date",
       xAxis: myTimeAxis,
       yAxis: myCurrencyAxis,
       dataTipFunction:YAHOO.example.formatDataTipText,
       wmode:"transparent",
       //only needed for flash player express install
       expressInstall: "assets/expressinstall.swf"
       })

        
          


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