Esempio n. 1
0
 public ChartModel getChartModel(int segments) {
   ChartModel cm =
       new ChartModel("Sales by Month 2007", "font-size: 14px; font-family: Verdana;");
   cm.setBackgroundColour("-1");
   XAxis xa = new XAxis();
   for (String m : TestData.getMonths()) {
     Label l = new Label(m, 45);
     l.setSize(10);
     l.setColour("#000000");
     xa.addLabels(l);
   }
   xa.setGridColour("-1");
   cm.setXAxis(xa);
   YAxis ya = new YAxis();
   ya.setSteps(16);
   ya.setMax(160);
   ya.setGridColour("#8888FF");
   cm.setYAxis(ya);
   BarChart bchart = new BarChart(BarStyle.GLASS);
   bchart.setColour("#FF00CC");
   bchart.setTooltip("$#val#");
   for (int t = 0; t < 12; t++) {
     if (t == segments - 1) {
       bchart.addBars(new BarChart.Bar(Random.nextInt(50) + 50, "#8888FF"));
     } else {
       bchart.addValues(Random.nextInt(50) + 50);
     }
   }
   cm.addChartConfig(bchart);
   return cm;
 }
Esempio n. 2
0
 public ChartModel getChartModel(int segments) {
   ChartModel cm =
       new ChartModel(
           "Sales by Month 2008", "font-size: 14px; font-family: Verdana; color:#ffff00;");
   cm.setBackgroundColour("#000077");
   XAxis xa = new XAxis();
   xa.setLabels(TestData.getShortMonths(segments));
   xa.getLabels().setColour("#ffff00");
   xa.setGridColour("-1");
   xa.setColour("#aa5500");
   xa.setZDepth3D(5);
   cm.setXAxis(xa);
   YAxis ya = new YAxis();
   ya.setSteps(16);
   ya.setMax(160);
   ya.setGridColour("#000099");
   ya.setColour("#ffff00");
   cm.setYAxis(ya);
   cm.setYAxisLabelStyle(10, "#ffff00");
   BarChart bchart = new BarChart(BarStyle.THREED);
   bchart.setColour("#CC6600");
   bchart.setTooltip("$#val#");
   for (int t = 0; t < segments; t++) {
     bchart.addValues(Random.nextInt(50) + 50);
   }
   cm.addChartConfig(bchart);
   return cm;
 }
Esempio n. 3
0
 public ChartModel getChartModel(int segments) {
   ChartModel cm =
       new ChartModel(
           "Sales by Month",
           "font-size: 16px; font-weight: bold; font-family: Verdana; color:#008800;");
   cm.setBackgroundColour("#eeffee");
   cm.setDecimalSeparatorComma(true);
   XAxis xa = new XAxis();
   xa.setLabels(TestData.getShortMonths(segments));
   xa.getLabels().setColour("#009900");
   xa.setGridColour("#eeffee");
   xa.setColour("#009900");
   cm.setXAxis(xa);
   YAxis ya = new YAxis();
   ya.setRange(5000, 20000);
   ya.setSteps(1000);
   ya.setGridColour("#eeffee");
   ya.setColour("#009900");
   cm.setYAxisLabelStyle(10, "#009900");
   cm.setYAxis(ya);
   FilledBarChart bchart = new FilledBarChart("#6666ff", "#000066");
   bchart.setTooltip("$#val#");
   for (int t = 0; t < segments; t++) {
     bchart.addValues(Random.nextInt(5000) + 10000);
   }
   cm.addChartConfig(bchart);
   return cm;
 }