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

YUI Chart TimeAxis Formatting - only last 3 dates shown

Expand Messages
  • Arun Gupta
    Am using YUI Charts in a Rails app. The data consists of dates on X-Axis and miles on Y-Axis and there is data available for past 6 months. Y-Axis is formatted
    Message 1 of 11 , Jul 17, 2009
    View Source
    • 0 Attachment
      Am using YUI Charts in a Rails app. The data consists of dates on X-Axis and miles on Y-Axis and there is data available for past 6 months.

      Y-Axis is formatted as:

      getMilesAxisLabel = function() {
      var milesAxis = new YAHOO.widget.NumericAxis();
      milesAxis.title = 'Distance (miles)';
      milesAxis.alwaysShowZero = true;
      milesAxis.majorUnit = 1;
      milesAxis.minorUnit = 0.5;
      milesAxis.labelFunction = formatMilesAxisLabel;
      return milesAxis;
      }

      and that works. I try to format X-Axis as:

      getDateAxisLabel = function() {
      var dateAxis = new YAHOO.widget.TimeAxis();
      dateAxis.title = "Date";
      return dateAxis;
      }

      But then only the 3 most recent dates show up on the X-Axis and no data is displayed in the chart. Any idea ?

      -Arun
    • tripp.bridges
      Please post a link that reproduces your issue. Thanks, Tripp
      Message 2 of 11 , Jul 17, 2009
      View Source
      • 0 Attachment
        Please post a link that reproduces your issue.

        Thanks,
        Tripp
        --- In ydn-javascript@yahoogroups.com, "Arun Gupta" <arun.gupta@...> wrote:
        >
        > Am using YUI Charts in a Rails app. The data consists of dates on X-Axis and miles on Y-Axis and there is data available for past 6 months.
        >
        > Y-Axis is formatted as:
        >
        > getMilesAxisLabel = function() {
        > var milesAxis = new YAHOO.widget.NumericAxis();
        > milesAxis.title = 'Distance (miles)';
        > milesAxis.alwaysShowZero = true;
        > milesAxis.majorUnit = 1;
        > milesAxis.minorUnit = 0.5;
        > milesAxis.labelFunction = formatMilesAxisLabel;
        > return milesAxis;
        > }
        >
        > and that works. I try to format X-Axis as:
        >
        > getDateAxisLabel = function() {
        > var dateAxis = new YAHOO.widget.TimeAxis();
        > dateAxis.title = "Date";
        > return dateAxis;
        > }
        >
        > But then only the 3 most recent dates show up on the X-Axis and no data is displayed in the chart. Any idea ?
        >
        > -Arun
        >
      • Arun Gupta
        Tripp, The application is internally hosted so can t be seen externally. I can share the snapshots and scripts if that helps ? -Arun
        Message 3 of 11 , Jul 17, 2009
        View Source
        • 0 Attachment
          Tripp,

          The application is internally hosted so can't be seen externally. I can share the snapshots and scripts if that helps ?

          -Arun

          --- In ydn-javascript@yahoogroups.com, "tripp.bridges" <trippb@...> wrote:
          >
          > Please post a link that reproduces your issue.
          >
          > Thanks,
          > Tripp
          > --- In ydn-javascript@yahoogroups.com, "Arun Gupta" <arun.gupta@> wrote:
          > >
          > > Am using YUI Charts in a Rails app. The data consists of dates on X-Axis and miles on Y-Axis and there is data available for past 6 months.
          > >
          > > Y-Axis is formatted as:
          > >
          > > getMilesAxisLabel = function() {
          > > var milesAxis = new YAHOO.widget.NumericAxis();
          > > milesAxis.title = 'Distance (miles)';
          > > milesAxis.alwaysShowZero = true;
          > > milesAxis.majorUnit = 1;
          > > milesAxis.minorUnit = 0.5;
          > > milesAxis.labelFunction = formatMilesAxisLabel;
          > > return milesAxis;
          > > }
          > >
          > > and that works. I try to format X-Axis as:
          > >
          > > getDateAxisLabel = function() {
          > > var dateAxis = new YAHOO.widget.TimeAxis();
          > > dateAxis.title = "Date";
          > > return dateAxis;
          > > }
          > >
          > > But then only the 3 most recent dates show up on the X-Axis and no data is displayed in the chart. Any idea ?
          > >
          > > -Arun
          > >
          >
        • Dwight Bridges
          If you cannot provide a link, you can provide enough front end code (html, js) for me to reproduce the issue. I¹ll also need your data source. If it is xhr,
          Message 4 of 11 , Jul 18, 2009
          View Source
          • 0 Attachment
            Re: [ydn-javascript] Re: YUI Chart TimeAxis Formatting - only last 3 dates shown If you cannot provide a link, you can provide enough front end code (html, js) for me to reproduce the issue. I’ll also need your data source. If it is xhr, the data returned will be fine.

            Thanks,
            Tripp


            On 7/17/09 11:45 PM, "Arun Gupta" <arun.gupta@...> wrote:


             
             

            Tripp,

            The application is internally hosted so can't be seen externally. I can share the snapshots and scripts if that helps ?

            -Arun

            --- In ydn-javascript@yahoogroups.com <mailto:ydn-javascript%40yahoogroups.com> , "tripp.bridges" <trippb@...> wrote:
            >
            > Please post a link that reproduces your issue.
            >
            > Thanks,
            > Tripp
            > --- In ydn-javascript@yahoogroups.com <mailto:ydn-javascript%40yahoogroups.com> , "Arun Gupta" <arun.gupta@> wrote:
            > >
            > > Am using YUI Charts in a Rails app. The data consists of dates on X-Axis and miles on Y-Axis and there is data available for past 6 months.
            > >
            > > Y-Axis is formatted as:
            > >
            > > getMilesAxisLabel = function() {
            > >     var milesAxis = new YAHOO.widget.NumericAxis();
            > >     milesAxis.title = 'Distance (miles)';
            > >     milesAxis.alwaysShowZero = true;
            > >     milesAxis.majorUnit = 1;
            > >     milesAxis.minorUnit = 0.5;
            > >     milesAxis.labelFunction = formatMilesAxisLabel;
            > >     return milesAxis;
            > > }
            > >
            > > and that works. I try to format X-Axis as:
            > >
            > > getDateAxisLabel = function() {
            > >     var dateAxis = new YAHOO.widget.TimeAxis();
            > >     dateAxis.title = "Date";
            > >     return dateAxis;
            > > }
            > >
            > > But then only the 3 most recent dates show up on the X-Axis and no data is displayed in the chart. Any idea ?
            > >
            > > -Arun
            > >
            >

              
                


          • Arun Gupta
            Tripp, Here is the complete JavaScript: -- cut here -- YAHOO.widget.Chart.SWFURL = http://yui.yahooapis.com/2.7.0/build/charts/assets/charts.swf ; //--- data
            Message 5 of 11 , Jul 20, 2009
            View Source
            • 0 Attachment
              Tripp,

              Here is the complete JavaScript:

              -- cut here --
              YAHOO.widget.Chart.SWFURL = "http://yui.yahooapis.com/2.7.0/build/charts/assets/charts.swf";

              //--- data

              YAHOO.example.monthlyExpenses =
              [
              { month: "2009-01-01", rent: 880.00, utilities: 894.68 },
              { month: "2009-01-02", rent: 880.00, utilities: 901.35 },
              { month: "2009-01-03", rent: 880.00, utilities: 889.32 },
              { month: "2009-01-04", rent: 880.00, utilities: 884.71 }
              ];

              var myDataSource = new YAHOO.util.DataSource( YAHOO.example.monthlyExpenses );
              myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
              myDataSource.responseSchema =
              {
              fields: [ "month", "rent", "utilities" ]
              };

              //--- chart

              var seriesDef =
              [
              { displayName: "Rent", yField: "rent" },
              { displayName: "Utilities", yField: "utilities" }
              ];


              formatDateAxisLabel = function(value)
              {
              return YAHOO.util.Date.format(value, "%b %d", "en");
              }

              getDateAxisLabel = function() {
              var dateAxis = new YAHOO.widget.TimeAxis();
              dateAxis.title = "Date";
              dateAxis.labelFunction = formatDateAxisLabel;
              return dateAxis;
              }

              YAHOO.util.Event.onAvailable('chart', function() {
              new YAHOO.widget.LineChart( "chart", myDataSource,
              {
              series: seriesDef,
              xField: "month"
              // xAxis: getDateAxisLabel()
              });
              }, this);
              -- cut here --

              And here is the Rails view:

              -- cut here --
              <h1>Chart#day</h1>
              <p>Find me in app/views/chart/day.html.erb</p>
              <%= stylesheet_link_tag 'http://yui.yahooapis.com/combo?2.7.0/build/calendar/assets/skins/sam/calendar.css' %>
              <%= javascript_include_tag 'http://yui.yahooapis.com/combo?2.7.0/build/yahoo/yahoo-min.js&2.7.0/build/event/event-min.js&2.7.0/build/dom/dom-min.js&2.7.0/build/calendar/calendar-min.js&2.7.0/build/datasource/datasource-min.js&2.7.0/build/element/element-min.js&2.7.0/build/json/json-min.js&2.7.0/build/charts/charts-min.js' %>

              <%= javascript_include_tag 'chart2' %>

              <div id="chart">
              </div>
              -- cut here --

              Running the script as is shows the correct chart. If getDateAxisLabel() is uncommented in LineChart ctor then only the 3 most recent dates are shown.

              Let me know if you are able to reproduce the issue using these fragments.

              Thanks,
              -Arun

              --- In ydn-javascript@yahoogroups.com, Dwight Bridges <trippb@...> wrote:
              >
              > If you cannot provide a link, you can provide enough front end code (html,
              > js) for me to reproduce the issue. I¹ll also need your data source. If it is
              > xhr, the data returned will be fine.
              >
              > Thanks,
              > Tripp
              >
              >
              > On 7/17/09 11:45 PM, "Arun Gupta" <arun.gupta@...> wrote:
              >
              > >
              > >
              > >
              > >
              > > Tripp,
              > >
              > > The application is internally hosted so can't be seen externally. I can share
              > > the snapshots and scripts if that helps ?
              > >
              > > -Arun
              > >
              > > --- In ydn-javascript@yahoogroups.com
              > > <mailto:ydn-javascript%40yahoogroups.com> , "tripp.bridges" <trippb@>
              > > wrote:
              > >> >
              > >> > Please post a link that reproduces your issue.
              > >> >
              > >> > Thanks,
              > >> > Tripp
              > >> > --- In ydn-javascript@yahoogroups.com
              > >> <mailto:ydn-javascript%40yahoogroups.com> , "Arun Gupta" <arun.gupta@> wrote:
              > >>> > >
              > >>> > > Am using YUI Charts in a Rails app. The data consists of dates on X-Axis
              > >>> and miles on Y-Axis and there is data available for past 6 months.
              > >>> > >
              > >>> > > Y-Axis is formatted as:
              > >>> > >
              > >>> > > getMilesAxisLabel = function() {
              > >>> > > var milesAxis = new YAHOO.widget.NumericAxis();
              > >>> > > milesAxis.title = 'Distance (miles)';
              > >>> > > milesAxis.alwaysShowZero = true;
              > >>> > > milesAxis.majorUnit = 1;
              > >>> > > milesAxis.minorUnit = 0.5;
              > >>> > > milesAxis.labelFunction = formatMilesAxisLabel;
              > >>> > > return milesAxis;
              > >>> > > }
              > >>> > >
              > >>> > > and that works. I try to format X-Axis as:
              > >>> > >
              > >>> > > getDateAxisLabel = function() {
              > >>> > > var dateAxis = new YAHOO.widget.TimeAxis();
              > >>> > > dateAxis.title = "Date";
              > >>> > > return dateAxis;
              > >>> > > }
              > >>> > >
              > >>> > > But then only the 3 most recent dates show up on the X-Axis and no data
              > >>> is displayed in the chart. Any idea ?
              > >>> > >
              > >>> > > -Arun
              > >>> > >
              > >> >
              > >
              > >
              > >
              > >
              > >>
              >
            • Dwight Bridges
              You will need to use a valid date string in your datasource to use the TimeAxis. 2009/01/01 works 2009-01-01 does not work Hope this helps. Tripp ... on
              Message 6 of 11 , Jul 20, 2009
              View Source
              • 0 Attachment
                Re: [ydn-javascript] Re: YUI Chart TimeAxis Formatting - only last 3 dates shown You will need to use a valid date string in your datasource to use the TimeAxis.

                2009/01/01 works
                2009-01-01  does not work

                Hope this helps.

                Tripp


                On 7/20/09 9:25 AM, "Arun Gupta" <arun.gupta@...> wrote:


                 
                 

                Tripp,

                Here is the complete JavaScript:

                -- cut here --
                YAHOO.widget.Chart.SWFURL = "http://yui.yahooapis.com/2.7.0/build/charts/assets/charts.swf";

                //--- data

                YAHOO.example.monthlyExpenses =
                [
                { month: "2009-01-01", rent: 880.00, utilities: 894.68 },
                { month: "2009-01-02", rent: 880.00, utilities: 901.35 },
                { month: "2009-01-03", rent: 880.00, utilities: 889.32 },
                { month: "2009-01-04", rent: 880.00, utilities: 884.71 }
                ];

                var myDataSource = new YAHOO.util.DataSource( YAHOO.example.monthlyExpenses );
                myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
                myDataSource.responseSchema =
                {
                fields: [ "month", "rent", "utilities" ]
                };

                //--- chart

                var seriesDef =
                [
                { displayName: "Rent", yField: "rent" },
                { displayName: "Utilities", yField: "utilities" }
                ];

                formatDateAxisLabel = function(value)
                {
                 return YAHOO.util.Date.format(value, "%b %d", "en");
                }

                getDateAxisLabel = function() {
                 var dateAxis = new YAHOO.widget.TimeAxis();
                 dateAxis.title = "Date";
                 dateAxis.labelFunction = formatDateAxisLabel;
                 return dateAxis;
                }

                YAHOO.util.Event.onAvailable('chart', function() {
                 new YAHOO.widget.LineChart( "chart", myDataSource,
                {
                series: seriesDef,
                xField: "month"
                //                xAxis: getDateAxisLabel()
                });
                }, this);
                -- cut here --

                And here is the Rails view:

                -- cut here --
                <h1>Chart#day</h1>
                <p>Find me in app/views/chart/day.html.erb</p>
                <%= stylesheet_link_tag 'http://yui.yahooapis.com/combo?2.7.0/build/calendar/assets/skins/sam/calendar.css' %>
                <%= javascript_include_tag 'http://yui.yahooapis.com/combo?2.7.0/build/yahoo/yahoo-min.js&2.7.0/build/event/event-min.js&2.7.0/build/dom/dom-min.js&2.7.0/build/calendar/calendar-min.js&2.7.0/build/datasource/datasource-min.js&2.7.0/build/element/element-min.js&2.7.0/build/json/json-min.js&2.7.0/build/charts/charts-min.js' %>

                <%= javascript_include_tag 'chart2' %>

                <div id="chart">
                </div>
                -- cut here --

                Running the script as is shows the correct chart. If getDateAxisLabel() is uncommented in LineChart ctor then only the 3 most recent dates are shown.

                Let me know if you are able to reproduce the issue using these fragments.

                Thanks,
                -Arun

                --- In ydn-javascript@yahoogroups.com <mailto:ydn-javascript%40yahoogroups.com> , Dwight Bridges <trippb@...> wrote:
                >
                > If you cannot provide a link, you can provide enough front end code (html,
                > js) for me to reproduce the issue. I’ll also need your data source. If it is
                > xhr, the data returned will be fine.
                >
                > Thanks,
                > Tripp
                >
                >
                > On 7/17/09 11:45 PM, "Arun Gupta" <arun.gupta@...> wrote:
                >
                > >  
                > >  
                > >  
                > >
                > > Tripp,
                > >
                > > The application is internally hosted so can't be seen externally. I can share
                > > the snapshots and scripts if that helps ?
                > >
                > > -Arun
                > >
                > > --- In ydn-javascript@yahoogroups.com <mailto:ydn-javascript%40yahoogroups.com>
                > > <mailto:ydn-javascript%40yahoogroups.com> , "tripp.bridges" <trippb@>
                > > wrote:
                > >> >
                > >> > Please post a link that reproduces your issue.
                > >> >
                > >> > Thanks,
                > >> > Tripp
                > >> > --- In ydn-javascript@yahoogroups.com <mailto:ydn-javascript%40yahoogroups.com>
                > >> <mailto:ydn-javascript%40yahoogroups.com> , "Arun Gupta" <arun.gupta@> wrote:
                > >>> > >
                > >>> > > Am using YUI Charts in a Rails app. The data consists of dates on X-Axis
                > >>> and miles on Y-Axis and there is data available for past 6 months.
                > >>> > >
                > >>> > > Y-Axis is formatted as:
                > >>> > >
                > >>> > > getMilesAxisLabel = function() {
                > >>> > >     var milesAxis = new YAHOO.widget.NumericAxis();
                > >>> > >     milesAxis.title = 'Distance (miles)';
                > >>> > >     milesAxis.alwaysShowZero = true;
                > >>> > >     milesAxis.majorUnit = 1;
                > >>> > >     milesAxis.minorUnit = 0.5;
                > >>> > >     milesAxis.labelFunction = formatMilesAxisLabel;
                > >>> > >     return milesAxis;
                > >>> > > }
                > >>> > >
                > >>> > > and that works. I try to format X-Axis as:
                > >>> > >
                > >>> > > getDateAxisLabel = function() {
                > >>> > >     var dateAxis = new YAHOO.widget.TimeAxis();
                > >>> > >     dateAxis.title = "Date";
                > >>> > >     return dateAxis;
                > >>> > > }
                > >>> > >
                > >>> > > But then only the 3 most recent dates show up on the X-Axis and no data
                > >>> is displayed in the chart. Any idea ?
                > >>> > >
                > >>> > > -Arun
                > >>> > >
                > >> >
                > >
                > >   
                > >     
                > >
                > >>
                >

                  
                    


              • Arun Gupta
                Ah that got rid of the last 3 dates issue. But the specified format is still mm/dd/yyyy instead of specifying: formatDateAxisLabel = function(value) { return
                Message 7 of 11 , Jul 20, 2009
                View Source
                • 0 Attachment
                  Ah that got rid of the "last 3 dates" issue. But the specified format is still mm/dd/yyyy instead of specifying:

                  formatDateAxisLabel = function(value)
                  {
                  return YAHOO.util.Date.format(value, "%b %d", "en-US");
                  }

                  getDateAxisLabel = function() {
                  var dateAxis = new YAHOO.widget.TimeAxis();
                  dateAxis.title = "Date";
                  dateAxis.labelFunction = formatDateAxisLabel;
                  return dateAxis;
                  }

                  I tried with "en" locale as well.

                  On a side note, how do I automatically set the locale ?

                  -Arun


                  --- In ydn-javascript@yahoogroups.com, Dwight Bridges <trippb@...> wrote:
                  >
                  > You will need to use a valid date string in your datasource to use the
                  > TimeAxis.
                  >
                  > 2009/01/01 works
                  > 2009-01-01 does not work
                  >
                  > Hope this helps.
                  >
                  > Tripp
                  >
                  >
                • Dwight Bridges
                  The format argument needs to be of type object with a property of format: var formatDateAxisLabel = function(value) { return YAHOO.util.Date.format(value,
                  Message 8 of 11 , Jul 20, 2009
                  View Source
                  • 0 Attachment
                    Re: [ydn-javascript] Re: YUI Chart TimeAxis Formatting - only last 3 dates shown The format argument needs to be of type object with a property of format:

                    var formatDateAxisLabel = function(value)
                    {
                        return YAHOO.util.Date.format(value, {format:"%b %d"}, "en-US");
                    }

                    That will do it.

                    Tripp

                    On 7/20/09 2:58 PM, "Arun Gupta" <arun.gupta@...> wrote:


                     
                     

                    Ah that got rid of the "last 3 dates" issue. But the specified format is still mm/dd/yyyy instead of specifying:

                    formatDateAxisLabel = function(value)
                    {
                     return YAHOO.util.Date.format(value, "%b %d", "en-US");
                    }

                    getDateAxisLabel = function() {
                     var dateAxis = new YAHOO.widget.TimeAxis();
                     dateAxis.title = "Date";
                     dateAxis.labelFunction = formatDateAxisLabel;
                     return dateAxis;
                    }

                    I tried with "en" locale as well.

                    On a side note, how do I automatically set the locale ?

                    -Arun

                    --- In ydn-javascript@yahoogroups.com <mailto:ydn-javascript%40yahoogroups.com> , Dwight Bridges <trippb@...> wrote:
                    >
                    > You will need to use a valid date string in your datasource to use the
                    > TimeAxis.
                    >
                    > 2009/01/01 works
                    > 2009-01-01  does not work
                    >
                    > Hope this helps.
                    >
                    > Tripp
                    >
                    >

                      
                        


                  • Arun Gupta
                    Excellent, that nailed it for me. The sample doc at http://developer.yahoo.com/yui/charts/#axislabels threw me off. I ll post a pointer to the forum once my
                    Message 9 of 11 , Jul 20, 2009
                    View Source
                    • 0 Attachment
                      Excellent, that nailed it for me.

                      The sample doc at http://developer.yahoo.com/yui/charts/#axislabels threw me off.

                      I'll post a pointer to the forum once my application goes live hopefully in few days.

                      Thanks,
                      -Arun

                      --- In ydn-javascript@yahoogroups.com, Dwight Bridges <trippb@...> wrote:
                      >
                      > The format argument needs to be of type object with a property of format:
                      >
                      > var formatDateAxisLabel = function(value)
                      > {
                      > return YAHOO.util.Date.format(value, {format:"%b %d"}, "en-US");
                      > }
                      >
                      > That will do it.
                      >
                      > Tripp
                      >
                      > On 7/20/09 2:58 PM, "Arun Gupta" <arun.gupta@...> wrote:
                      >
                      > >
                      > >
                      > >
                      > >
                      > > Ah that got rid of the "last 3 dates" issue. But the specified format is still
                      > > mm/dd/yyyy instead of specifying:
                      > >
                      > > formatDateAxisLabel = function(value)
                      > > {
                      > > return YAHOO.util.Date.format(value, "%b %d", "en-US");
                      > > }
                      > >
                      > > getDateAxisLabel = function() {
                      > > var dateAxis = new YAHOO.widget.TimeAxis();
                      > > dateAxis.title = "Date";
                      > > dateAxis.labelFunction = formatDateAxisLabel;
                      > > return dateAxis;
                      > > }
                      > >
                      > > I tried with "en" locale as well.
                      > >
                      > > On a side note, how do I automatically set the locale ?
                      > >
                      > > -Arun
                      > >
                      > > --- In ydn-javascript@yahoogroups.com
                      > > <mailto:ydn-javascript%40yahoogroups.com> , Dwight Bridges <trippb@> wrote:
                      > >> >
                      > >> > You will need to use a valid date string in your datasource to use the
                      > >> > TimeAxis.
                      > >> >
                      > >> > 2009/01/01 works
                      > >> > 2009-01-01 does not work
                      > >> >
                      > >> > Hope this helps.
                      > >> >
                      > >> > Tripp
                      > >> >
                      > >> >
                      > >
                      > >
                      > >
                      > >
                      > >>
                      >
                    • Arun Gupta
                      The complete app, including the source code and image snapshots, is available at: http://blogs.sun.com/arungupta/entry/track_your_running_miles_using It shows
                      Message 10 of 11 , Jul 29, 2009
                      View Source
                      • 0 Attachment
                        The complete app, including the source code and image snapshots, is available at:

                        http://blogs.sun.com/arungupta/entry/track_your_running_miles_using

                        It shows how YUI is integrated with Rails.

                        Thanks,
                        -Arun

                        --- In ydn-javascript@yahoogroups.com, "Arun Gupta" <arun.gupta@...> wrote:
                        >
                        > Excellent, that nailed it for me.
                        >
                        > The sample doc at http://developer.yahoo.com/yui/charts/#axislabels threw me off.
                        >
                        > I'll post a pointer to the forum once my application goes live hopefully in few days.
                        >
                        > Thanks,
                        > -Arun
                        >
                        > --- In ydn-javascript@yahoogroups.com, Dwight Bridges <trippb@> wrote:
                        > >
                        > > The format argument needs to be of type object with a property of format:
                        > >
                        > > var formatDateAxisLabel = function(value)
                        > > {
                        > > return YAHOO.util.Date.format(value, {format:"%b %d"}, "en-US");
                        > > }
                        > >
                        > > That will do it.
                        > >
                        > > Tripp
                        > >
                        > > On 7/20/09 2:58 PM, "Arun Gupta" <arun.gupta@> wrote:
                        > >
                        > > >
                        > > >
                        > > >
                        > > >
                        > > > Ah that got rid of the "last 3 dates" issue. But the specified format is still
                        > > > mm/dd/yyyy instead of specifying:
                        > > >
                        > > > formatDateAxisLabel = function(value)
                        > > > {
                        > > > return YAHOO.util.Date.format(value, "%b %d", "en-US");
                        > > > }
                        > > >
                        > > > getDateAxisLabel = function() {
                        > > > var dateAxis = new YAHOO.widget.TimeAxis();
                        > > > dateAxis.title = "Date";
                        > > > dateAxis.labelFunction = formatDateAxisLabel;
                        > > > return dateAxis;
                        > > > }
                        > > >
                        > > > I tried with "en" locale as well.
                        > > >
                        > > > On a side note, how do I automatically set the locale ?
                        > > >
                        > > > -Arun
                        > > >
                        > > > --- In ydn-javascript@yahoogroups.com
                        > > > <mailto:ydn-javascript%40yahoogroups.com> , Dwight Bridges <trippb@> wrote:
                        > > >> >
                        > > >> > You will need to use a valid date string in your datasource to use the
                        > > >> > TimeAxis.
                        > > >> >
                        > > >> > 2009/01/01 works
                        > > >> > 2009-01-01 does not work
                        > > >> >
                        > > >> > Hope this helps.
                        > > >> >
                        > > >> > Tripp
                        > > >> >
                        > > >> >
                        > > >
                        > > >
                        > > >
                        > > >
                        > > >>
                        > >
                        >
                      • Eric Miraglia
                        Arun, Thanks for sharing. This is up on our Twitter feed -- http://twitter.com/yuilibrary/status/2922144634 -- and it will be in our next installment of In
                        Message 11 of 11 , Jul 29, 2009
                        View Source
                        • 0 Attachment
                          Arun,

                          Thanks for sharing.  This is up on our Twitter feed --


                          -- and it will be in our next installment of "In the Wild".

                          -Eric


                          From: Arun Gupta <arun.gupta@...>
                          To: ydn-javascript@yahoogroups.com
                          Sent: Wednesday, July 29, 2009 6:07:38 AM
                          Subject: [ydn-javascript] Source code availableRe: YUI Chart TimeAxis Formatting - only last 3 dates shown

                           

                          The complete app, including the source code and image snapshots, is available at:

                          http://blogs. sun.com/arungupt a/entry/track_ your_running_ miles_using

                          It shows how YUI is integrated with Rails.

                          Thanks,
                          -Arun

                          --- In ydn-javascript@ yahoogroups. com, "Arun Gupta" <arun.gupta@ ...> wrote:
                          >
                          > Excellent, that nailed it for me.
                          >
                          > The sample doc at http://developer. yahoo.com/ yui/charts/ #axislabels threw me off.
                          >
                          > I'll post a pointer to the forum once my application goes live hopefully in few days.
                          >
                          > Thanks,
                          > -Arun
                          >
                          > --- In ydn-javascript@ yahoogroups. com, Dwight Bridges <trippb@> wrote:
                          > >
                          > > The format argument needs to be of type object with a property of format:
                          > >
                          > > var formatDateAxisLabel = function(value)
                          > > {
                          > > return YAHOO.util.Date. format(value, {format:"%b %d"}, "en-US");
                          > > }
                          > >
                          > > That will do it.
                          > >
                          > > Tripp
                          > >
                          > > On 7/20/09 2:58 PM, "Arun Gupta" <arun.gupta@ > wrote:
                          > >
                          > > >
                          > > >
                          > > >
                          > > >
                          > > > Ah that got rid of the "last 3 dates" issue. But the specified format is still
                          > > > mm/dd/yyyy instead of specifying:
                          > > >
                          > > > formatDateAxisLabel = function(value)
                          > > > {
                          > > > return YAHOO.util.Date. format(value, "%b %d", "en-US");
                          > > > }
                          > > >
                          > > > getDateAxisLabel = function() {
                          > > > var dateAxis = new YAHOO.widget. TimeAxis( );
                          > > > dateAxis.title = "Date";
                          > > > dateAxis.labelFunct ion = formatDateAxisLabel ;
                          > > > return dateAxis;
                          > > > }
                          > > >
                          > > > I tried with "en" locale as well.
                          > > >
                          > > > On a side note, how do I automatically set the locale ?
                          > > >
                          > > > -Arun
                          > > >
                          > > > --- In ydn-javascript@ yahoogroups. com
                          > > > <mailto:ydn- javascript% 40yahoogroups. com> , Dwight Bridges <trippb@> wrote:
                          > > >> >
                          > > >> > You will need to use a valid date string in your datasource to use the
                          > > >> > TimeAxis.
                          > > >> >
                          > > >> > 2009/01/01 works
                          > > >> > 2009-01-01 does not work
                          > > >> >
                          > > >> > Hope this helps.
                          > > >> >
                          > > >> > Tripp
                          > > >> >
                          > > >> >
                          > > >
                          > > >
                          > > >
                          > > >
                          > > >>
                          > >
                          >

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