Exception in thread "main" java.lang.ClassCastException: org.jfree.chart.plot.CategoryPlot cannot be cast to org.jfree.chart.plot.XYPlot
at org.jfree.chart.JFreeChart.getXYPlot(JFreeChart.java:828)
at tony.BarChartDemo.showview(BarChartDemo.java:61)
at tony.BarChartDemo.main(BarChartDemo.java:90)异常 

解决方案 »

  1.   

    XYPlot plot=  chart.getXYPlot();   <!--异常出在这一行-->
    ValueAxis axis =   plot.getDomainAxis();
    axis.setVerticalTickLabels(true);
      

  2.   

    类型转换
    at org.jfree.chart.JFreeChart.getXYPlot(JFreeChart.java:828) 
    检查抛出给的那个类的那一行
      

  3.   

    没弄过jfreechart
    看看帮助文件~ chart.getXYPlot();返回的是org.jfree.chart.plot.CategoryPlot 不能转换到XYPlot plot
      

  4.   

    chart
    问题出在你创建这个chat的时候,不应该用 CategoryPlot你去看看你的那个 new 语句吧,hehe .
      

  5.   

    那应该用什么类型来创建chatr