Announcement

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

    How to use FacetChart without a DataBoundComponent

    How to generate a Chart without using data from a DataBound Component. I want to query a datasource and create a graph out of it.

    Checked FacetChart API, didn't find any means of setting label Fields like we set when we call chartData() on a listGrid.

    I have a list grid which data is fetched with some custom grouping on multiple fields and uses PAGE Fetch Mode. I would like to generate a Graph which is grouped on a different field which should also be sorted and projected on to a graph. So I need all the data prior to generating the graph but do not want to lose the paging Mode for the ListGrid. I want to generate a graph just by using DataSource (with a different operation binding) without using any particular DataBoundComponents like ListGrid etc. Is this possible?



    Thanks.
    Last edited by curiousgally; 7 Apr 2011, 07:14.

    #2
    This is shown in one of the new Charting samples that were just added to the SmartGWT EE Showcase in the nightlies - you just use DataSource.fetchData() and construct the FacetChart in the callback.

    Comment


      #3
      But will the example in the nightly work with smartgwtee-2.4??

      Datasource API doesn't have setFetchOperation() method. So, is it not possible to use DataSource as you have mentioned but with a sepecific operation binding.

      Thanks.
      Last edited by curiousgally; 7 Apr 2011, 08:38.

      Comment


        #4
        Some of those samples would, but several APIs shown in the samples did not yet exist in 2.4, so you should just run from the nightly.

        Comment


          #5
          I could use the new nightly build to develope some sample graphs.

          Few doubts:

          1) Both Area and Line graphs look the same when I implement though they are different in the showcase examples.

          2) Can't we not plot multiple value Fields using facetCharts.

          ex: I have employeeId,Income,Bonus

          I would like to plot employeeId on x-axis and stacked bar indicating bonus and income.
          This is straight forward when u plot using listGrid.chartData() where you can pass an array of data fields.

          3) Is there a way to customize the graphs.

          ex: Showing legend (depicts the actual number i.e height of the bar in case of column chart).
          Colors of bars etc.
          When I have one facet it renders same color for all the different possible values of the facet. Is it possible to change this behaviour.


          Thanks.
          Last edited by curiousgally; 8 Apr 2011, 13:37.

          Comment


            #6
            Just compare your code to the sample very carefully, including comparing the responses in the RPC tab to what you see in the sample. If you need more help, show both the code and the data you're using with the chart.

            Comment

            Working...
            X