Exemplo n.º 1
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;
 }
Exemplo n.º 2
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;
 }