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

26519RE: [ydn-javascript] ColumnChart isn't working with TimeAxis

Expand Messages
  • Josh Tynjala
    Feb 29 10:20 AM
    • 0 Attachment

      This is the expected behavior. A ColumnChart, by design, may only use a CategoryAxis for its xAxis value. Similarly, a BarChart can only use a CategoryAxis for its yAxis value. The reasoning behind this restriction is that columns and bars from multiple series are meant to cluster around a single point (the category). This involves offsetting them a bit to make them all appear side by side. That simply doesn’t make sense on a TimeAxis where the positioning is so important.

      Josh Tynjala
      Yahoo!

       


      From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of d.zhiharev
      Sent: Friday, February 29, 2008 12:42 AM
      To: ydn-javascript@yahoogroups.com
      Subject: [ydn-javascript] ColumnChart isn't working with TimeAxis

       

      I want to display ColumnChart on TimeAxis, but see nothing.
      For example:
      ------------ --------- --------- --------- --
      var stats = [
      { date: new Date(2000,1, 1), value: 1 },
      { date: new Date(2000,1, 2), value: 2 },
      { date: new Date(2000,1, 5), value: 1 }
      ];

      var myDataSource = new YAHOO.util.DataSour ce(
      stats, {
      responseType: YAHOO.util.DataSour ce.TYPE_JSARRAY,
      responseSchema: {fields:["date" , "value"]
      }
      });

      //this code displays ColumChart on CategoryAxis - works well
      new YAHOO.widget. ColumnChart( "chart1", myDataSource, {
      xField: "date",
      yField: "value"
      });

      //his code displays LineChart on TimeAxis - works well
      new YAHOO.widget. LineChart( "chart2", myDataSource, {
      xAxis: new YAHOO.widget. TimeAxis( ),
      xField: "date",
      yField: "value"
      });

      //but this code displays only TimeAxis without any chart :(
      new YAHOO.widget. ColumnChart( "chart3", myDataSource, {
      xAxis: new YAHOO.widget. TimeAxis( ),
      xField: "date",
      yField: "value"
      });
      ------------ --------- --------- --------- -------
      I didn't find any examples of ColumnChart with TimeAxis and didn't
      find any remarks in documentation about this problem.

      Is it possible to use ColumnChart with TimeAxis?
      What should I do?

      Best regards,
      Dmitry Zhiharev

    • Show all 5 messages in this topic