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

Charts: Any attempt to add "style" breaks the chart rendering?

Expand Messages
  • markrob35
    I have successfully, and quite easily gotten charts working as desired. Well, mostly... I want to style them, of course but... Any attempt to add the style
    Message 1 of 6 , Mar 17, 2009
    View Source
    • 0 Attachment
      I have successfully, and quite easily gotten charts working as desired. Well, mostly... I want to style them, of course but...

      Any attempt to add the style attribute causes the charts to stop working. It doesn't matter whether I create the style separately or inline; whether I do my own or cut-and-paste directly from a working example; when I add the style attribute:

      1. No data is displayed.

      2. The grid scale is mucked-up; I use a NumericAxis() to set a minimum and maximum, and that's ignored.

      3. Firefox's error console shows this error, WITHOUT a line number reference: "Expected ':' but found 'undefined'. Declaration dropped."

      Obviously from the error, it's dropping the entire declaration for the ColumnChart, which accounts for the grid scale going away. But I have looked until blue in the face, and I cannot see anywhere that there's a colon (:) out-of-place, missing, etc., or any other code formatting mistake. In fact, I cannot see where there's any real substantive difference between my chart and the examples aside from the source data, which work fine in the chart until the style attribute is added.

      Does anyone have a clue why it's being funky?
    • markrob35
      Tripp (and the group), Lessons learned... The problem was a missing reference to the JSON JavaScript file, on which there is a dependency here. Now, why on
      Message 2 of 6 , Mar 17, 2009
      View Source
      • 0 Attachment
        Tripp (and the group),

        Lessons learned... The "problem" was a missing reference to the JSON JavaScript file, on which there is a dependency here.

        Now, why on Earth this wasn't apparent before is beyond me. After closing everything down, and then re-opening my web project (this is an ASP.NET MVC application) to access the code and respond to Tripp's query, I re-ran the page in Internet Explorer, and it threw an error about YAHOO.lang.JSON which made it clear what was wrong. Why Firefox still only shows the colon error (in my original post) is beyond me, and why IE didn't cough-up this error before is also not apparent.

        But for sure, another lesson here about the *.js and *.css dependencies needing to be "right" if you expect things to actually work. ;-) It's just complicated a great deal by the fact that, in this application, some references are in master pages (views in MVC context), and some are in the actual pages (views).

        Mark



        --- In ydn-javascript@yahoogroups.com, "tripp.bridges" <trippb@...> wrote:
        >
        > Could you please post a test link or the entirety of your code so that I can take a look?
        >
        > Thanks,
        > Tripp
        > --- In ydn-javascript@yahoogroups.com, "markrob35" <markrob35@> wrote:
        > >
        > > I have successfully, and quite easily gotten charts working as desired. Well, mostly... I want to style them, of course but...
        > >
        > > Any attempt to add the style attribute causes the charts to stop working. It doesn't matter whether I create the style separately or inline; whether I do my own or cut-and-paste directly from a working example; when I add the style attribute:
        > >
        > > 1. No data is displayed.
        > >
        > > 2. The grid scale is mucked-up; I use a NumericAxis() to set a minimum and maximum, and that's ignored.
        > >
        > > 3. Firefox's error console shows this error, WITHOUT a line number reference: "Expected ':' but found 'undefined'. Declaration dropped."
        > >
        > > Obviously from the error, it's dropping the entire declaration for the ColumnChart, which accounts for the grid scale going away. But I have looked until blue in the face, and I cannot see anywhere that there's a colon (:) out-of-place, missing, etc., or any other code formatting mistake. In fact, I cannot see where there's any real substantive difference between my chart and the examples aside from the source data, which work fine in the chart until the style attribute is added.
        > >
        > > Does anyone have a clue why it's being funky?
        > >
        >
      • santini.alberto
        ... About Firefox s error console showing this error, without a line number reference - Expected : but found undefined . Declaration dropped. - I have an
        Message 3 of 6 , Mar 25, 2009
        View Source
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, "tripp.bridges" <trippb@...> wrote:
          >
          > Could you please post a test link or the entirety of your code so that I can take a look?
          >

          About Firefox's error console showing this error, without a line number reference - "Expected ':' but found 'undefined'. Declaration dropped." - I have an example.

          http://proplus.aptanacloud.com/ConPA/ConPA.html

          Insert three asset and get the optimal portfolio.

          In FF console you will see that message.

          The stack trace is the following:
          Expected ':' but found 'undefined'. Declaration dropped.
          (?)()()ConPA.js (line 530)
          getTarget()()combo?2....ew-min.js (line 13)
          setHeader()("cellMouseoutEvent", Object target=td.yui-dt0-col-type event=Event mouseout, undefined, undefined)combo?2....ew-min.js (line 17)
          _onTableKeypress()(mouseout clientX=507, clientY=118, DataTable instance yui-dt0 _nIndex=0 _sId=yui-dt0 _oChainRender=Object)combo?2....ew-min.js (line 162)
          getTarget()()

          Thanks in advance,
          Alberto
        • jrbramble
          I haven t used the charts but once, and it was a while ago. http://www.ancestry.com/advertising/default.aspx Here I have bar and pie charts. You may be able
          Message 4 of 6 , Mar 26, 2009
          View Source
          • 0 Attachment
            I haven't used the charts but once, and it was a while ago.

            http://www.ancestry.com/advertising/default.aspx

            Here I have bar and pie charts. You may be able to look at the JS files to see how I styled them.

            --- In ydn-javascript@yahoogroups.com, "markrob35" <markrob35@...> wrote:
            >
            > I have successfully, and quite easily gotten charts working as desired. Well, mostly... I want to style them, of course but...
            >
            > Any attempt to add the style attribute causes the charts to stop working. It doesn't matter whether I create the style separately or inline; whether I do my own or cut-and-paste directly from a working example; when I add the style attribute:
            >
            > 1. No data is displayed.
            >
            > 2. The grid scale is mucked-up; I use a NumericAxis() to set a minimum and maximum, and that's ignored.
            >
            > 3. Firefox's error console shows this error, WITHOUT a line number reference: "Expected ':' but found 'undefined'. Declaration dropped."
            >
            > Obviously from the error, it's dropping the entire declaration for the ColumnChart, which accounts for the grid scale going away. But I have looked until blue in the face, and I cannot see anywhere that there's a colon (:) out-of-place, missing, etc., or any other code formatting mistake. In fact, I cannot see where there's any real substantive difference between my chart and the examples aside from the source data, which work fine in the chart until the style attribute is added.
            >
            > Does anyone have a clue why it's being funky?
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.