Ejemplo n.º 1
0
  public void setRegion(String region) {
    this.currentRegion = region;
    renderer.setChartTitle(region);
    renderer.getSeriesRendererAt(0).setColor(colors[viewMode]);
    ((XYSeriesRenderer) renderer.getSeriesRendererAt(0))
        .setFillBelowLineColor(0x33000000 | colors[viewMode]);
    if (getComponentForm() != null) {

      XYMultiSeriesTransition t = new XYMultiSeriesTransition(chart, dataSet);
      RegionData[] rdArr = data.getRegionData(region);
      for (RegionData rd : rdArr) {
        switch (viewMode) {
          case VIEW_MODE_POPULATION:
            dataSet.getSeriesAt(0).setTitle("Population");
            t.getBuffer().getSeriesAt(POPULATION).add(rd.year, rd.pop);
            break;
          case VIEW_MODE_DENSITY:
            dataSet.getSeriesAt(0).setTitle("Density (People per square mile)");
            t.getBuffer().getSeriesAt(POPULATION).add(rd.year, rd.density);
            break;
          default:
            throw new RuntimeException("Illegal view mode.");
        }

        // t.getBuffer().getSeriesAt(DENSITY).add(rd.year, rd.density);
        // t.getBuffer().getSeriesAt(RANK).add(rd.year, rd.rank);
      }
      t.animateChart();
    } else {
      RegionData[] rdArr = data.getRegionData(region);
      renderer.getSeriesRendererAt(0).setColor(colors[viewMode]);
      for (RegionData rd : rdArr) {

        switch (viewMode) {
          case VIEW_MODE_POPULATION:
            dataSet.getSeriesAt(POPULATION).add(rd.year, rd.pop);
            dataSet.getSeriesAt(0).setTitle("Population");

            break;
          case VIEW_MODE_DENSITY:
            dataSet.getSeriesAt(0).setTitle("Density (People per square mile)");
            dataSet.getSeriesAt(POPULATION).add(rd.year, rd.density);
            break;
          default:
            throw new RuntimeException("Illegal view mode");
        }
      }
      Log.p("Finished adding pop data");
    }
  }
Ejemplo n.º 2
0
 protected void yearPressed(int year) {
   Log.p("Year pressed " + year);
 }
Ejemplo n.º 3
0
 public void send(String values) {
   Log.p("Fallbacking to AnalyticsService");
   AnalyticsService.setAppsMode(true);
   AnalyticsService.init(trackingId, appName);
   AnalyticsService.visit(screenName, referrer);
 }