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

Re: charts: how to set xaxis and yaxis labels?

Expand Messages
  • tripp.bridges
    Hi, You can format the axis labels through the labelFunction of you axis. It is described in the Customizing Axis Labels section here:
    Message 1 of 5 , Oct 1, 2008
    • 0 Attachment
      Hi,
      You can format the axis labels through the labelFunction of you axis.
      It is described in the Customizing Axis Labels section here:

      http://developer.yahoo.com/yui/charts/#using

      Thanks,
      Tripp
      --- In ydn-javascript@yahoogroups.com, Shige Takeda <stakeda@...> wrote:
      >
      > Charts 2.5.2 or 2.6:
      >
      > Could anybody know how to set the X-Axis / Y-Axis labels?
      > Can NumericAxis object include it or Chart object?
      >
      > I would like to add "Recall/TRP" to Y-Axis and "FPR" to X-Axis but have
      > no clue which method/property take them...
      >
      > ...
      > var fields = ['fpr'];
      > var series = [];
      > for (var i=0; i<taskIDs.length; ++i){
      > var yf = 'tpr_' + projects[i] + '_' + tasks[i];
      > fields.push(yf);
      > series.push({
      > displayName: tasks[i] + "(" + projects[i] + ")",
      > yField: yf,
      > style: {size: 1, lineSize:1}
      > });
      > }
      >
      > jsonData.responseType = YAHOO.util.DataSource.TYPE_JSON;
      > jsonData.responseSchema = {
      > resultsList: "result",
      > fields: fields
      > };
      >
      > var xAxis = new YAHOO.widget.NumericAxis();
      > xAxis.minimum = 0;
      > xAxis.maximum = 0.1;
      > xAxis.majorUnit = 0.02;
      >
      > var yAxis = new YAHOO.widget.NumericAxis();
      > yAxis.minimum = 0;
      > yAxis.maximum = 1;
      > yAxis.majorUnit = 0.1;
      > mChaROC = new YAHOO.widget.LineChart( "chart",
      jsonData, {
      > xField: 'fpr',
      > series: series,
      > xAxis: xAxis,
      > yAxis: yAxis,
      > style: {
      > legend: {display:'bottom'}
      > },
      > // only needed for flash player express install
      > expressInstall: "../expressinstall.swf"
      > });
      >
      >
      > Thanks,
      > -- Shige
      >
    • Shige Takeda
      Hi Tripp, thanks for the answer, that s not what I want, though. What I would like to have is the labels that describes X/Y value for each. Some Y Axis labels
      Message 2 of 5 , Oct 2, 2008
      • 0 Attachment
        Hi Tripp, thanks for the answer, that's not what I want, though.

        What I would like to have is the labels that describes X/Y value for each.

        Some Y Axis labels are rotated in -90 degree, others are displayed
        vertically; see "TPR"as shown in this ASCII figure:

        1.0 | ===========
        | =
        0.8 | =
        T | ===
        P 0.6 | ==
        R | ==
        0.4 | =
        | =
        0.2 |=
        |=
        0,0 +------------------------
        0.01 0.50 0.10 0.15
        FPR

        and the X Axis label 'FPR' is placed below the X Axis.

        # btw, sorry for the duplicate posts...

        Regards,
        -- Shige

        tripp.bridges wrote:
        >
        > Hi,
        > You can format the axis labels through the labelFunction of you axis.
        > It is described in the Customizing Axis Labels section here:
        >
        > http://developer.yahoo.com/yui/charts/#using
        > <http://developer.yahoo.com/yui/charts/#using>
        >
        > Thanks,
        > Tripp
        > --- In ydn-javascript@yahoogroups.com
        > <mailto:ydn-javascript%40yahoogroups.com>, Shige Takeda <stakeda@...>
        > wrote:
        > >
        > > Charts 2.5.2 or 2.6:
        > >
        > > Could anybody know how to set the X-Axis / Y-Axis labels?
        > > Can NumericAxis object include it or Chart object?
        > >
        > > I would like to add "Recall/TRP" to Y-Axis and "FPR" to X-Axis but have
        > > no clue which method/property take them...
        > >
        > > ...
        > > var fields = ['fpr'];
        > > var series = [];
        > > for (var i=0; i<taskIDs.length; ++i){
        > > var yf = 'tpr_' + projects[i] + '_' + tasks[i];
        > > fields.push(yf);
        > > series.push({
        > > displayName: tasks[i] + "(" + projects[i] + ")",
        > > yField: yf,
        > > style: {size: 1, lineSize:1}
        > > });
        > > }
        > >
        > > jsonData.responseType = YAHOO.util.DataSource.TYPE_JSON;
        > > jsonData.responseSchema = {
        > > resultsList: "result",
        > > fields: fields
        > > };
        > >
        > > var xAxis = new YAHOO.widget.NumericAxis();
        > > xAxis.minimum = 0;
        > > xAxis.maximum = 0.1;
        > > xAxis.majorUnit = 0.02;
        > >
        > > var yAxis = new YAHOO.widget.NumericAxis();
        > > yAxis.minimum = 0;
        > > yAxis.maximum = 1;
        > > yAxis.majorUnit = 0.1;
        > > mChaROC = new YAHOO.widget.LineChart( "chart",
        > jsonData, {
        > > xField: 'fpr',
        > > series: series,
        > > xAxis: xAxis,
        > > yAxis: yAxis,
        > > style: {
        > > legend: {display:'bottom'}
        > > },
        > > // only needed for flash player express install
        > > expressInstall: "../expressinstall.swf"
        > > });
        > >
        > >
        > > Thanks,
        > > -- Shige
        > >
        >
        >
        >
      • tripp.bridges
        Hi, You are not able to rotate your labels in YUI Charts. You may be able to place your TPR and FPR outside of the chart to create a similar effect. Thanks,
        Message 3 of 5 , Oct 5, 2008
        • 0 Attachment
          Hi,

          You are not able to rotate your labels in YUI Charts. You may be able
          to place your TPR and FPR outside of the chart to create a similar effect.

          Thanks,
          Tripp
          --- In ydn-javascript@yahoogroups.com, Shige Takeda <stakeda@...> wrote:
          >
          > Hi Tripp, thanks for the answer, that's not what I want, though.
          >
          > What I would like to have is the labels that describes X/Y value for
          each.
          >
          > Some Y Axis labels are rotated in -90 degree, others are displayed
          > vertically; see "TPR"as shown in this ASCII figure:
          >
          > 1.0 | ===========
          > | =
          > 0.8 | =
          > T | ===
          > P 0.6 | ==
          > R | ==
          > 0.4 | =
          > | =
          > 0.2 |=
          > |=
          > 0,0 +------------------------
          > 0.01 0.50 0.10 0.15
          > FPR
          >
          > and the X Axis label 'FPR' is placed below the X Axis.
          >
          > # btw, sorry for the duplicate posts...
          >
          > Regards,
          > -- Shige
          >
          > tripp.bridges wrote:
          > >
          > > Hi,
          > > You can format the axis labels through the labelFunction of you axis.
          > > It is described in the Customizing Axis Labels section here:
          > >
          > > http://developer.yahoo.com/yui/charts/#using
          > > <http://developer.yahoo.com/yui/charts/#using>
          > >
          > > Thanks,
          > > Tripp
          > > --- In ydn-javascript@yahoogroups.com
          > > <mailto:ydn-javascript%40yahoogroups.com>, Shige Takeda <stakeda@>
          > > wrote:
          > > >
          > > > Charts 2.5.2 or 2.6:
          > > >
          > > > Could anybody know how to set the X-Axis / Y-Axis labels?
          > > > Can NumericAxis object include it or Chart object?
          > > >
          > > > I would like to add "Recall/TRP" to Y-Axis and "FPR" to X-Axis
          but have
          > > > no clue which method/property take them...
          > > >
          > > > ...
          > > > var fields = ['fpr'];
          > > > var series = [];
          > > > for (var i=0; i<taskIDs.length; ++i){
          > > > var yf = 'tpr_' + projects[i] + '_' + tasks[i];
          > > > fields.push(yf);
          > > > series.push({
          > > > displayName: tasks[i] + "(" + projects[i] + ")",
          > > > yField: yf,
          > > > style: {size: 1, lineSize:1}
          > > > });
          > > > }
          > > >
          > > > jsonData.responseType = YAHOO.util.DataSource.TYPE_JSON;
          > > > jsonData.responseSchema = {
          > > > resultsList: "result",
          > > > fields: fields
          > > > };
          > > >
          > > > var xAxis = new YAHOO.widget.NumericAxis();
          > > > xAxis.minimum = 0;
          > > > xAxis.maximum = 0.1;
          > > > xAxis.majorUnit = 0.02;
          > > >
          > > > var yAxis = new YAHOO.widget.NumericAxis();
          > > > yAxis.minimum = 0;
          > > > yAxis.maximum = 1;
          > > > yAxis.majorUnit = 0.1;
          > > > mChaROC = new YAHOO.widget.LineChart( "chart",
          > > jsonData, {
          > > > xField: 'fpr',
          > > > series: series,
          > > > xAxis: xAxis,
          > > > yAxis: yAxis,
          > > > style: {
          > > > legend: {display:'bottom'}
          > > > },
          > > > // only needed for flash player express install
          > > > expressInstall: "../expressinstall.swf"
          > > > });
          > > >
          > > >
          > > > Thanks,
          > > > -- Shige
          > > >
          > >
          > >
          > >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.