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

23323RE: [ydn-javascript] Re: LinesCharts - Series color and markers

Expand Messages
  • Josh Tynjala
    Jan 2 11:15 AM

      And you’re passing in the series definition with the “series” attribute on the chart?

       

      Example:

       

              var mychart = new YAHOO.widget.ColumnChart( "chart", salesData,
              {
                     series: seriesDef, // <- series definition
                     xField: "month"
              });

       

       

      You should see in the skinning example that setting the color works.

       

      http://developer.yahoo.com/yui/examples/charts/charts-skins.html

       

      The example code at the bottom of that page doesn’t include the colors (I’ll be sure to update it), but if you look at the page source, you can see the series definition I used for that particular example:

       

              var seriesDef =
              [
                     {
                             yField: "pork",
                             displayName: "Sales of Pork",
                             style:
                             {
                                     image: "assets/tube.png",
                                     mode: "no-repeat",
                                     color: 0x2e434d,
                                     size: 40
                             }
                     },
                     {
                             yField: "beef",
                             displayName: "Sales of Beef",
                             style:
                             {
                                     image: "assets/tube.png",
                                     mode: "no-repeat",
                                     color: 0xc2d81e,
                                     size: 40
                             }
                     }
              ];

       

      Josh Tynjala

      Yahoo! Flash Platform


      From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of kdaws_karl
      Sent: Wednesday, January 02, 2008 10:30 AM
      To: ydn-javascript@yahoogroups.com
      Subject: [ydn-javascript] Re: LinesCharts - Series color and markers

       

      --- In ydn-javascript@ yahoogroups. com, "Josh Tynjala" <jtynjala@.. .>
      wrote:

      >
      > Karl, you need to set the style as part of the series definition:
      >
      > var seriesDef =
      > [
      > {
      > displayName: "Rent",
      > yField: "rent",
      > style:
      > {
      > color: 0xff0000,
      > size: 20
      > }
      > },
      > {
      > displayName: "Utilities",
      > yField: "utilities",
      > style:
      > {
      > color: 0x0000ff,
      > size: 30
      > }
      > }
      > ];

      Hi,

      Thanks for the reply, but that's one of the methods that I tried and
      it appears to have no effect at all. In my test I've told it the color
      should be 0x00ff00 so I'd notice if it had changed anything, but it
      hasn't :(

      Thanks,

      Karl

    • Show all 9 messages in this topic