7 Replies Latest reply on Apr 15, 2015 9:10 PM by HammerOz

    Web viewer html 5 address. What's wrong?

    HammerOz

      HI guys,

       

      I thought I would have a crack at this.  I don't have a html background . The webviewer is showing the status wheel which makes me think I am close... or not.

       

       

      The site  Chart Widget Wizard - TradingView

      say embed this:

       

      <!-- TradingView Widget BEGIN -->

      <script type="text/javascript" src="https://d33t3vvu2t2yu5.cloudfront.net/tv.js"></script>

      <script type="text/javascript">

      new TradingView.widget({

        "width": 998,

        "height": 610,

        "symbol": "FX:SPX500",

        "interval": "D",

        "timezone": "exchange",

        "theme": "White",

        "style": "3",

        "toolbar_bg": "#f1f3f6",

        "allow_symbol_change": true,

        "hideideas": true

      });

      </script>

      <!-- TradingView Widget END -->

       

       

      My custom viewer address attempt:

       

      "data:text/html;charset=utf-8," &

      "<html xmlns=\"http://www.w3.org/1999/xhtml\">"& ¶ &

      "<head>" & ¶ &

       

       

      "<script type=\"text/javascript\" src=\"https://d33t3vvu2t2yu5.cloudfront.net/tv.js\"></script>"& ¶ &

       

       

      "</head>" & ¶ & "<body>" & ¶ &

       

      "<script type=\"text/javascript\">" & ¶ &

       

       

      "new TradingView.widget({"& ¶ &

        "\"width\": 998,"& ¶ &

        "\"height\": 610,"& ¶ &

        "\"symbol\": \"FX:SPX500\","& ¶ &

        "\"interval\": \"D\","& ¶ &

        "\"timezone\": \"exchange\","& ¶ &

        "\"theme\": \"White\","& ¶ &

        "\"style\": \"3\","& ¶ &

        "\"toolbar_bg\": \"#f1f3f6\"," & ¶ &

        "\"allow_symbol_change\": true,"& ¶ &

        "\"hideideas\": true"& ¶ &

      "});" & ¶ &

       

      "</script>" & ¶ &

       

      "</body></html>"

       

       

       

      Thanks in advance

        • 1. Re: Web viewer html 5 address. What's wrong?
          mikebeargie

          html5 may not be supported in all versions of the filemaker web viewer.

           

          That said, maybe try simplifying your html header info to the most basic form, changing this:

          "data:text/html;charset=utf-8," &

          "<html xmlns=\"http://www.w3.org/1999/xhtml\">"& ¶ &

          to this:

          "data:text/html," &

          "<html>"& ¶ &

          • 2. Re: Web viewer html 5 address. What's wrong?
            matthew_odell

            Another suggestion is to create an actual HTML file, and see if that works in a browser, then in a a web viewer. If it does, then copy that HTML into a field in your solution (possibly global), and have the web viewer call:

             

            "data:text/html," &

            ResourceTable::ChartHTML

             

            Having it in a field also makes it endlessly easier to edit if you need to fix anything.

            • 3. Re: Web viewer html 5 address. What's wrong?
              nicolai

              I tried Mike Beargie  suggestion and it does not help, the result is the same.

               

              I also tried to load an html file saved locally and tried to load the same file served from a web server. So this is not a problem with data URL. the server is a local one ( python SimpleHTTPServer) so could be a different result if served from a proper one.

               

              I can see the spinning animation, so it links to the library, but does not display the chart.

               

              At the same time all versions I tried load successfully in Safari and Chrome. I am on FM 12 MAC OSX 10.9

               

              I thought if you can display it in Safari it should be able to display in Web Viewer.

               

              I think, for some reason it just take a very long time to render. I will try to leave it to run a bit longer.

              • 4. Re: Web viewer html 5 address. What's wrong?
                HammerOz

                Thanks for having a crack at this Nicolai. 

                • 5. Re: Web viewer html 5 address. What's wrong?
                  HammerOz

                  Thanks for the responses.

                   

                  I just tried a simple test. I specified the base url www.tradingview.com . Once on the site in the viewer, clicking the Charts menu for the site produces the same ongoing ticker.

                   

                  So it appears web viewer cant deal with the fancy interactive charting

                   

                  Bit of a shame as this charting is responsive, interactive, covers most markets ... oh and did I mention free!

                   

                  PS. Sorry forgot to mention I am running current versions of Mac os / safari and filemaker .

                  • 6. Re: Web viewer html 5 address. What's wrong?
                    user19752

                    The code worked on FM13 on Windows7, so it may not be problem.

                    (As mikebeargie mentioned, default installation FM13 run as IE9, so need to edit registry)

                    • 7. Re: Web viewer html 5 address. What's wrong?
                      HammerOz

                      Thanks 19752,

                       

                      I have continued to play with this because the widgets are fully responsive so look good. I tried different widgets on tradingview .

                       

                      For future readers I found the best way to approach is go to:

                      1. Chart Widget Wizard - TradingView
                      2. Customise the desired widget ( they will resize automatically to your viewer size within reason)
                      3. on Mac : right click the widget (after applying customisations) open in new window
                      4. Copy the new window address into web viewer (obviously can replace market codes with calculated fields in your system then)

                       

                      The following widget does not work in web viewer (MAC / FM13 / IOS .3)  (it opens very nicely via open url however and in reality it probably need the screen space on iPad)

                       

                      TradingView Chart Widget

                       

                      The ones that work in viewer

                       

                      TradingView Mini Chart Widget

                      TradingView Medium Chart Widget

                       

                      So a good US market visuals site. Not so good for international equities and not so good for data. For data api I  use barchart for free commodities and yahoo for most global stocks. With much more fiddling to get the data into my solutions.