Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    OFC for Smartgwt

    I develop an application using Smartgwt. Just one thing that is missing in it - chart. I decided to write my own implementation of Open Flash Chart(http://ofc2dz.com/) for smartgwt using flashlet and then put it somewhere(e.g. googlecode). But first of all I want to ask: Is there any ready implementations? Why is Smartgwt have no its own implementation of any chart?(licence, any other points of view)

    #2
    It seems I finally finished my work, but still want to know about my question

    Comment


      #3
      I've packed initial version of OFC chart for Smartgwt. It is based on ofcgwt 2.0.1 beta, but uses Smartgwt's Flashlet. All you need to use it - is
      Code:
      <inherits name="com.smartgwt.ofcchart.OFCChart4SGWT"/>
      , import jar in classpath and use like it ofcgwt.

      For todo: I want to implement work with Datasource

      Here the jar file http://dl.dropbox.com/u/690921/OFCChart4SGWT-1.0.jar

      Comment


        #4
        Good to see

        Hi,

        Good to see this.
        This gives us an alternative to GWT Visualization.

        Do you have some code samples etc.., connected with this...or is it pretty easy to put together..


        Cheers
        Strawman

        Comment


          #5
          I'll try to put some of the samples, but you can watch samples for GXT http://www.extjs.com/examples/#chartgallery, except data binding.

          Comment


            #6
            Originally posted by Metallic
            [...] Is there any ready implementations? Why is Smartgwt have no its own implementation of any chart?(licence, any other points of view)
            Have you seen this? http://www.smartclient.com/#gridCharting

            This is part of SmartClient, only a java wrapper is missing, and then it can be incorporated into SmartGWT. (Would be nice.)

            Comment


              #7
              Originally posted by Metallic
              I decided to write my own implementation of Open Flash Chart(http://ofc2dz.com/) for smartgwt
              Do you mean a wrapper that can be conveniently used in SmartGWT, or is it really a new implementation (ie. a complete rewrite from stracth)?

              Comment


                #8
                Originally posted by Metallic
                I've packed initial version of OFC chart for Smartgwt. It is based on ofcgwt 2.0.1 beta, but uses Smartgwt's Flashlet. All you need to use it - is
                Code:
                <inherits name="com.smartgwt.ofcchart.OFCChart4SGWT"/>
                , import jar in classpath and use like it ofcgwt.
                I don't think it's a good idea to put your independent code in SmartGWT's NameSpace (com.smartgwt); that's contrary to the universally accepted Naming Convention of java.

                (See http://java.sun.com/docs/codeconv/ht....doc8.html#367)

                You should place your own packages in your own namespace.

                Comment


                  #9
                  I've got a problem in using OFC for Smartgwt.

                  I've downloaded jar file, provided by Metallic and added it to my project.
                  Then added an "inherits" record in my .gwt.xml file.

                  Code:
                  <?xml version="1.0" encoding="UTF-8"?>
                  <module rename-to='webarm'>
                    <inherits name='com.google.gwt.user.User'/>
                    <inherits name='com.smartgwt.SmartGwt'/>
                    <inherits name="com.smartgwt.SmartGwtPluginBridges"/>
                    <inherits name="com.smartgwt.ofcchart.OFCChart4SGWT"/>
                  
                    <inherits name='com.google.gwt.user.theme.standard.Standard'/>
                  
                    <extend-property name="locale" values="ru_RU"/>
                  
                    <entry-point class='com.tenzor.webarm.client.WebARM'/>
                  
                    <source path='client'/>
                  </module>

                  Here's the code I've written in "onModuleLoad" method:
                  Code:
                  LineChart lc = new LineChart();
                  lc.addValues(1, 2, 4, 8, 16, 32);
                  lc.addDots(new Dot(1),new Dot(2),new Dot(4),new Dot(8),new Dot(16),new Dot(32));
                          
                  ChartData cd = new ChartData();
                  cd.addElements(lc);
                          
                  ChartWidget cw = new ChartWidget();
                  cw.setWidth100();
                  cw.setHeight100();
                          
                  cw.setChartData(cd);
                          
                  Window w = new Window();
                  w.addChild(cw);
                  w.setCanDragResize(true);
                  w.setCanDrop(true);
                  w.show();
                          
                  HLayout dock = new HLayout();
                  dock.setCanAcceptDrop(true);
                          
                  RootPanel.get().add(dock);
                  So, after all this operations, when I run the server and navigate to it with my browser, I receive errors:
                  Code:
                  No source code is available for type com.smartgwt.ofcchart.client.model.elements.LineChart; did you forget to inherit a required module?
                  No source code is available for type com.smartgwt.ofcchart.client.model.elements.dot.Dot; did you forget to inherit a required module?
                  No source code is available for type com.smartgwt.ofcchart.client.model.ChartData; did you forget to inherit a required module?
                  No source code is available for type com.smartgwt.ofcchart.client.ChartWidget; did you forget to inherit a required module?
                  So, what can cause that errors?
                  I'm using GWT 2.0.3, SmartGWT 2.2, Firefox 3.5.7


                  P.S. Sorry for my bad english :)

                  Comment


                    #10
                    I've improved my project http://dl.dropbox.com/u/690921/OFCChart4SGWT-1.0.jar If it help somebody - I will create project on googlecode

                    PS Now you should inherit <inherits name="ua.metallic.ofcchart.OFCChart4SGWT"/>

                    Comment


                      #11
                      I think it would be very useful to add this to google code. Other enhancements worth exploring are making the Chart's directly support databinding with DataSource's. That would be quite powerful.

                      Sanjiv

                      Comment


                        #12
                        Originally posted by sjivan
                        I think it would be very useful to add this to google code. Other enhancements worth exploring are making the Chart's directly support databinding with DataSource's. That would be quite powerful.

                        Sanjiv
                        I've posted initial version to http://code.google.com/p/ofc4sgwt/, later I'll try to investigate and implement DataSource compatibility. Any help is appreciated.

                        Comment


                          #13
                          nice!

                          what do i have to do to get the "Save Image Locally" option to work?

                          or can you include it into your project?

                          edit: tooltips do not disappear, when i move the mouse over to another area in my application than the chart!?
                          Last edited by tredholz; 22 Jun 2010, 03:24.

                          Comment


                            #14
                            Originally posted by tredholz
                            nice!

                            what do i have to do to get the "Save Image Locally" option to work?

                            or can you include it into your project?

                            edit: tooltips do not disappear, when i move the mouse over to another area in my application than the chart!?
                            I temporary froze my work on this project, next week I plan to implement "Save image locally" feature, add DataSource compatibility and patch chart to remove tooltip(if it not hovers the point)

                            Comment


                              #15
                              sounds good...

                              trying to get it working on my own until then...

                              Comment

                              Working...
                              X