Comparable,你的getKey出来东西是不是可比的?或者实现了可以比较的接口

解决方案 »

  1.   

    兄弟,这么快。刚刚发。
       IT界都想你这样,中国就发达了。
        呵呵,谢了。
    DefaultPieDataset 的getKey(int i)方法就是返回Comparable类型啊;
        public Comparable getKey(int item) {
            return this.data.getKey(item);
        }    public Comparable getKey(int index) {
            Comparable result = null;
            KeyedValue item = (KeyedValue) this.data.get(index);
            if (item != null) {
                result = item.getKey();
            }
            return result;
        }
      

  2.   

    呵呵,你用的1.0.6的包吧,那个方法已经改成这样了
    pieplot.setSectionPaint("苹果",new Color(0,0,0));
      

  3.   

    dataset.setValue("苹果",100);pieplot.setSectionPaint("苹果",new Color(0,0,0));这样就ok
      

  4.   

    还是不行啊。出不来。 PiePlot plot = new PiePlot(data);
    System.out.println(data.getKey(0));//打印结果为"很好",说明有值。

    plot.setSectionPaint(data.getKey(0),new Color(0,0,0));
      

  5.   

    PiePlot pieplot = (PiePlot)chart.getPlot();
    这样就好