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

Re: [ydn-javascript] Re: how to change colors or put image in PIE chart.

Expand Messages
  • stephen eighmey
    Great information. Thank you very much. 2009/3/31 tripp.bridges
    Message 1 of 6 , Mar 31, 2009
    • 0 Attachment
      Great information.  Thank you very much.

      2009/3/31 tripp.bridges <trippb@...>

      For images: (assuming you have your images in the same directory as your application)



      var mychart = new YAHOO.widget.PieChart( "chart", opinionData,
      {
      dataField: "count",
      categoryField: "label",
      style:
      {
      legend:
      {
      display: "right",
      font:
      {
      family: "Arial",
      size: 12,
      wmode: "opaque"
      }
      }
      },
      expressInstall: "assets/expressinstall.swf",
      series:
      [
      {
      style:
      {
      mode:"stretch",
      images:["pink.gif", "blue.gif", "red.gif", "green.gif", "grey.gif"]
      }
      }
      ]

      });

      For colors:


      var mychart = new YAHOO.widget.PieChart( "chart", opinionData,
      {
      dataField: "count",
      categoryField: "label",
      style:
      {
      legend:
      {
      display: "right",
      font:
      {
      family: "Arial",
      size: 12,
      wmode: "opaque"
      }
      }
      },
      expressInstall: "assets/expressinstall.swf",

      series:
      [
      {
      style:
      {
      colors:[0xff0000, 0x0000ff, 0xdddddd, 0x00ccff]
      }
      }
      ]

      });

      For images, there is an extra style "mode" (documented here: http://developer.yahoo.com/yui/charts/#seriesstyles) which indicates how you want the image to display.

      Thanks,
      Tripp

      --- In ydn-javascript@yahoogroups.com, "stepheneighmey@..." <stepheneighmey@...> wrote:
      >
      > excellent... how would this series color information be inserted into this code...
      >
      > var mychart = new YAHOO.widget.PieChart( "chart", opinionData,
      > {
      > dataField: "count",
      > categoryField: "label",
      > style:
      > {
      > legend:
      > {
      > display: "right",
      > font:
      > {
      > family: "Arial",
      > size: 12,
      > wmode: "opaque"
      > }
      > }
      > },
      > expressInstall: "assets/expressinstall.swf"
      > });
      >


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