Ejemplo n.º 1
0
 public ChartModel getChartModel(int segments) {
   ChartModel cm =
       new ChartModel(
           "Licenses by Quarter 2008",
           "font-size: 14px; font-family: Verdana; text-align: center;");
   cm.setBackgroundColour("#ffffff");
   XAxis xa = new XAxis();
   xa.setLabels("Q1", "Q2", "Q3", "Q4");
   xa.setZDepth3D(5);
   xa.setTickHeight(4);
   xa.setOffset(true);
   xa.setColour("#909090");
   cm.setXAxis(xa);
   YAxis ya = new YAxis();
   ya.setSteps(16);
   ya.setMax(160);
   cm.setYAxis(ya);
   CylinderBarChart bchart = new CylinderBarChart();
   bchart.setColour("#440088");
   bchart.setAlpha(.8f);
   bchart.setTooltip("$#val#");
   for (int t = 0; t < 4; t++) {
     if ((t + 1) == (Math.ceil(segments / 3.0))) {
       bchart.addBars(new BarChart.Bar(Random.nextInt(50) + 50, "#aa88ff"));
     } else {
       bchart.addValues(Random.nextInt(50) + 50);
     }
   }
   cm.addChartConfig(bchart);
   return cm;
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
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;
 }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
0
 public ChartModel getChartModel(int segments) {
   ChartModel cm =
       new ChartModel(
           "Voted Best AJAX Framework",
           "font-size: 14px; font-family: Verdana; text-align: center;");
   XAxis xa = new XAxis();
   xa.setRange(0, 200, 50);
   cm.setXAxis(xa);
   YAxis ya = new YAxis();
   ya.addLabels("Ext", "Dojo", "jQuery", "YUI");
   ya.setOffset(true);
   cm.setYAxis(ya);
   HorizontalBarChart bchart = new HorizontalBarChart();
   bchart.setTooltip("#val# mph");
   bchart.addBars(new HorizontalBarChart.Bar(Random.nextInt(47) + 100, "#ffff00"));
   bchart.addBars(new HorizontalBarChart.Bar(Random.nextInt(44) + 100, "#0000ff"));
   bchart.addBars(new HorizontalBarChart.Bar(Random.nextInt(23) + 100, "#00ff00"));
   bchart.addBars(new HorizontalBarChart.Bar(Random.nextInt(50) + 150, "#ff0000"));
   cm.addChartConfig(bchart);
   cm.setTooltipStyle(new ToolTip(MouseStyle.FOLLOW));
   return cm;
 }