[ 9 posts ]

Antoine

  • Username: Grinn
  • Joined: Tue May 22, 2012 7:03 am
  • Posts: 17
  • GitHub: Grinn
  • Gists: Grinn
  • Offline
  • Profile

YUI 3.5.1 charts : dependencies issues on IE8

Post Posted: Wed May 30, 2012 1:38 am
+0-
Hi,

I am trying to make a charts with legends on IE8.
My web application can not go collect the info through YAHOO, so I included the framework 3.5.1 in the application.
I started by using this method :
Code:
YUI().use(''node-core','node-base','event-base','event-synthetic','event-mouseenter','event-touch','yui',...................... function (Y) {}

I found the the javascript needed using the YUI configurator with charts and charts-legend selected : http://yuilibrary.com/yui/configurator/
This didn't work but I added to that : "attribute", "base", "dd", "dom", "event", "event-custom", "event-simulate", "node", "pluginhost", "yui". And it worked on firefox.

On IE I tried the same thing (going on the yui configurator with IE shows you the specific IE librairie needed), but it didn't work.

I saw an easier way that doesn't seem to work neither for me on IE8 :
Code:
YUI({
                   debug: true,
                   combine: true,
                   base: 'mtmclient-web/src/main/webapp/frameworks/yui/',
                   root: '3.5.1/'
               }).use('charts','charts-legend','node','event',"attribute", "base", "dd", "dom", "event-custom", "event-simulate", "pluginhost", "yui", function (Y) {


Does someone have a idea of what I should try ?

Thank you

Tripp Bridges

YUI Developer

  • Username: tripp
  • Joined: Wed Jan 07, 2009 1:54 pm
  • Posts: 440
  • GitHub: tripp
  • Gists: tripp
  • YUI Developer
  • Offline
  • Profile

Re: YUI 3.5.1 charts : dependencies issues on IE8

Post Posted: Wed May 30, 2012 7:11 pm
+0-
The only module you need to include for charts with a legend is 'charts-legend'. This has been tested in IE8. I just ran quick test loading the same modules you are currently trying without issue. If you can post a link that reproduces your issue, I can help debug.

Thanks,
Tripp

Antoine

  • Username: Grinn
  • Joined: Tue May 22, 2012 7:03 am
  • Posts: 17
  • GitHub: Grinn
  • Gists: Grinn
  • Offline
  • Profile

Re: YUI 3.5.1 charts : dependencies issues on IE8

Post Posted: Thu May 31, 2012 3:10 am
+0-
Thank you for answerring so fast Tripp.


For now, I get an "Y.Chart is not a constructor".
I downloaded the whole YUI3.5.1 frameworks there : mtmclient-web/src/main/webapp/frameworks/yui

And I am simply trying to make the code that was working earlier using the : <script src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script> without this, but in local.

For this I added :
<script type="text/javascript" src="/mtmclient-web/src/main/webapp/frameworks/yui/3.5.1/build/yui/yui.js"></script>
<script type="text/javascript" src="/mtmclient-web/src/main/webapp/frameworks/yui/3.5.1/build/loader/loader.js"></script>
to my .jsp page.

In my javascript page I wrote :
Code:
YUI({
                     filter: "raw",
                   combine: true,
                   base: '/mtmclient-web/src/main/webapp/frameworks/yui/',
                   root: 'mtmclient-web/src/main/webapp/frameworks/yui/3.5.1/'
               }).use('charts-legend','charts',function (Y) {

                       var myBarChart = new Y.Chart({

                 // code here
          )};
       )};

}

Antoine

  • Username: Grinn
  • Joined: Tue May 22, 2012 7:03 am
  • Posts: 17
  • GitHub: Grinn
  • Gists: Grinn
  • Offline
  • Profile

Re: YUI 3.5.1 charts : dependencies issues on IE8

Post Posted: Thu May 31, 2012 4:49 am
+0-
Ok I found the problem!

I just needed to put that in base :
base: '/mtmclient-web/src/main/webapp/frameworks/yui/3.5.1/build/'
And not mention any "root"

Antoine

  • Username: Grinn
  • Joined: Tue May 22, 2012 7:03 am
  • Posts: 17
  • GitHub: Grinn
  • Gists: Grinn
  • Offline
  • Profile

Re: YUI 3.5.1 charts : dependencies issues on IE8

Post Posted: Fri Jun 01, 2012 12:11 am
+0-
In fact, by doing that, my page is still going out to download via the YAHOO plateform...
I don't really understand it anymore.

Is it possible to make this work without going through YAHOO ?

Antoine

  • Username: Grinn
  • Joined: Tue May 22, 2012 7:03 am
  • Posts: 17
  • GitHub: Grinn
  • Gists: Grinn
  • Offline
  • Profile

Re: YUI 3.5.1 charts : dependencies issues on IE8

Post Posted: Mon Jul 09, 2012 5:00 am
+0-
Hi,

I finally accepted to use chart going through the http://yui.yahooapis.com/ web site to display my charts.
But, weirdly, after a month without problem, my charts stop displaying at all.
I dont get a single error.

I checked via fireBug the script that were getting load, and realized my page stop going through the http://yui.yahooapis.com/.
I imagine it must be the reason of my problem.

So once again I am looking for a solution to display Charts without going through http://yui.yahooapis.com/. Here is what I am doing, but I can't see the charts, and I don't have errors :
Code:
YUI({
      filter: "raw",
                combine: true,
      base: '/mtmclient-web/src/main/webapp/frameworks/yui/build/'
      }).use('charts-legend', function (Y) {


If you think it can help, I can write down all the .js that are getting load from the YUI3.5.1 Framework on my page.

Thank you for your time

Tripp Bridges

YUI Developer

  • Username: tripp
  • Joined: Wed Jan 07, 2009 1:54 pm
  • Posts: 440
  • GitHub: tripp
  • Gists: tripp
  • YUI Developer
  • Offline
  • Profile

Re: YUI 3.5.1 charts : dependencies issues on IE8

Post Posted: Mon Jul 09, 2012 6:30 am
+0-
In your example, you are setting combine to true. Setting combine to true causes loader to use a combo service. By default, loader will use the combo service on yahooapis. You can change this by setting the comboBase property to the base path of your combo service but you will need to set up your own combo service. More info is documented here:
http://yuilibrary.com/yui/docs/api/classes/Loader.html

I found this thread which contains more info on running your own combo service:
http://yuilibrary.com/forum/viewtopic.php?p=19166

Alternatively, you can choose to skip the combo service altogether and the loader will load necessary files directly from your server.

Thanks,
Tripp

Antoine

  • Username: Grinn
  • Joined: Tue May 22, 2012 7:03 am
  • Posts: 17
  • GitHub: Grinn
  • Gists: Grinn
  • Offline
  • Profile

Re: YUI 3.5.1 charts : dependencies issues on IE8

Post Posted: Tue Jul 10, 2012 4:16 am
+0-
That is a great answer, thank you!

Being a JS beginner I would just like to make sure I fully understand the post.

By doing :
Code:
      YUI({
                   combine: false,    
                   base: 'mtmclient-web/src/main/webapp/frameworks/yui/3.5.1'

                      
               }).use('charts-legend', function (Y) {


And adding to it my own "combo" YUI is going to realise the same work in local.
Without a combo it will be longer and less efficient, right ?

Can I ask YUI to look for the JS files at the "base" adress without a combo, even if it is less efficient ? How could I write that?

The code I wrote is not displaying the charts I'm afraid...

Tripp Bridges

YUI Developer

  • Username: tripp
  • Joined: Wed Jan 07, 2009 1:54 pm
  • Posts: 440
  • GitHub: tripp
  • Gists: tripp
  • YUI Developer
  • Offline
  • Profile

Re: YUI 3.5.1 charts : dependencies issues on IE8

Post Posted: Tue Jul 10, 2012 7:38 am
+0-
The only performance hit you'll take from setting the combine property to false is more js files. (they won't be combined)

The easiest way to have files served from your server is to have the yui seed file served from you server. By default, the loader will server the files from the same place as your seed. (yui-min.js) The files will only be served from yahooapis if you serve your seed from yahooapis or you specify it do so in your config. (e.g. setting combine to true)

The below would serve files from your site: (yoursite.com)
Code:
<script type="text/javascript" src="http://yoursite.com/yui3/build/yui/yui-min.js"></script>
<script type="text/javascript">
YUI().use('charts', function(Y) {
    //your code
});
</script>


This would also serve files from your site:
Code:
<script type="text/javascript" src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
<script type="text/javascript">
YUI({
    combine: false,
    base: "http://yoursite.com/yui3/build/"
}).use('charts', function(Y) {
    //your code
});
</script>


Thanks,
Tripp
  [ 9 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum