Problem using CoreCharts

115 views
Skip to first unread message

JT

unread,
Jun 15, 2012, 10:44:00 AM6/15/12
to gwt-goo...@googlegroups.com
I'm using gwt-visualization 1.1.2. The deprecated charts work fine, but when I try to use the corecharts, the charts show up as varying error messages (in red, for example "this.k is undefined") depending on the ChartType/browser that I use.

I'm using the following:
    VisualizationUtils.loadVisualizationApi(onLoadCallback, CoreChart.PACKAGE);

Any ideas?
J

JT

unread,
Jun 18, 2012, 1:53:09 PM6/18/12
to gwt-goo...@googlegroups.com
I just tried using the "unofficial" chart API with the same results. How can I get to the bottom of this? It seems I'm using the API's correctly since the deprecated ones work fine. It looks like some Javascript problem in the visualization package. I'm surprised nobody else is having this problem.

this.k is undefined×

J

Eric Ayers

unread,
Jun 18, 2012, 2:14:50 PM6/18/12
to gwt-goo...@googlegroups.com
My guess is that your code access the API before the onloadcallback returns.
> --
> You are subscribed to the Google Groups "GWT-Google-Apis" group.
> For more options, visit http://groups.google.com/group/gwt-google-apis?hl=en



--
Eric Ayers | Software Engineer | zun...@google.com | +1 404 487 9229

JT

unread,
Jun 19, 2012, 1:06:12 PM6/19/12
to gwt-goo...@googlegroups.com
Here's the code:

  void showComparisonChart() {
    //Create DataTable for "selected" relative measures
    BarChart.Options options = BarChart.Options.create();
    options.setSize(800, 200);
    options.setTitle("Video Comparison");
    options.setReverseAxis(true);
    options.setShowCategories(true);

    BarChart compareChart = new BarChart(compareVideoData(), options);

    panelForVideoComparison.clear();
    panelForVideoComparison.add(compareChart);
  }

  private IRelativeMeasures comparisonMeasure;
  void showComparisonChart(IRelativeMeasures measure) {
    this.comparisonMeasure = measure;

    Runnable onLoadCallback = new Runnable() {
      public void run() {
        showComparisonChart();
      }
    };
    VisualizationUtils.loadVisualizationApi(onLoadCallback, BarChart.PACKAGE);
  }

Reply all
Reply to author
Forward
0 new messages