- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在运行一个程序,使用JFreeChart库和Groovy / Grails后端绘制折线图。这是我的代码:
package com.xyz.jfreechartdemo
import org.jfree.chart.ChartFactory
import org.jfree.chart.JFreeChart
import org.jfree.chart.plot.PlotOrientation
import org.jfree.data.category.DefaultCategoryDataset
class JFreeChartSample {
def getChart(){
def dataset = createDataset()
def chart = createChart(dataset)
return chart
}
def createDataset() {
DefaultCategoryDataset dataset = new DefaultCategoryDataset()
dataset.addValue(2000,"X",1)
dataset.addValue(3300,"X",2)
dataset.addValue(2000,"X",3)
dataset.addValue(3300,"X",4)
return dataset
}
def createChart(dataset){
JFreeChart chart = ChartFactory.createLineChart("Widget not rendered","X","Count",dataset,PlotOrientation.VERTICAL,false,true,false)
return chart
}
}
Compilation error: startup failed:
C:\Users\User\IdeaProjects\JFreeChartDemo\grails app\domain\com\xyz\jfreechartdemo\JFreeChartSample.groovy: 3: unable to resolve class org.jfree.chart.ChartFactory
@ line 3, column 1.
import org.jfree.chart.ChartFactory
^
C:\Users\User\IdeaProjects\JFreeChartDemo\grails-app\domain\com\xyz\jfreechartdemo\JFreeChartSample.groovy: 6: unable to resolve class org.jfree.data.category.DefaultCategoryDataset
@ line 6, column 1.
import org.jfree.data.category.DefaultCategoryDataset
^
C:\Users\User\IdeaProjects\JFreeChartDemo\grails-app\domain\com\xyz\jfreechartdemo\JFreeChartSample.groovy: 5: unable to resolve class org.jfree.chart.plot.PlotOrientation
@ line 5, column 1.
import org.jfree.chart.plot.PlotOrientation
^
C:\Users\User\IdeaProjects\JFreeChartDemo\grails-app\domain\com\xyz\jfreechartdemo\JFreeChartSample.groovy: 4: unable to resolve class org.jfree.chart.JFreeChart
@ line 4, column 1.
import org.jfree.chart.JFreeChart
^
4 errors
最佳答案
添加代码的步骤:
关于grails - Grails JFreeChart无法解析类:org.jfree.chart.ChartFactory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28871218/
默认情况下,JFreeChart 中的 XYStepChart 实现“来自概念”,如果我们有以下数据,这意味着什么:(1,4), ( 2,5)步骤图是这样画的: 从 x=1 到 x=2、y=4 的水平
我正在运行一个程序,使用JFreeChart库和Groovy / Grails后端绘制折线图。这是我的代码: package com.xyz.jfreechartdemo import
我使用以下代码使用 jfree.chart.ChartFactory 创建了一个条形图。我需要将 Y 轴的范围设置为 0 - 100。如何设置最大值。 import java.io.File; imp
我在我的项目中使用 AChartEngine 并通过以下方式在 build.gradle 中连接它 allprojects { repositories { jcenter()
我正在使用 JFreeChart 创建折线图。 折线图绘制正确,但我想从点 0 开始。我该怎么做? public void lineChart() { CategoryDataset
我想从 5.0.0 版之前的 Highcharts 和 highcharts-ng 0.0.12 版过渡到最新版本。 我知道图表对象有一些重要的变化,以及 highcharts-ng 在最新版本中的工
我是一名优秀的程序员,十分优秀!