在不使用任何插件的情况下,您可以将 jqPlot 添加到您的应用程序中,这意味着将项目文件复制到您的web-app
目录中。假设您正在使用 Grails 2.x,在applicationResources.groovy
您定义资源模块的 conf 目录中定义 jqPlot 资源。将您需要的文件添加到此模块中,以便您可以在应用程序中使用它们。您需要阅读 jqPlot 文档以确保您包含与图表相关的所有必需资源。
visualization {
dependsOn 'jquery'
resource url: 'jquery.jqplot/excanvas.min.js' ,disposition:'head' , bundle:'app'
resource url: 'jquery.jqplot/jquery.jqplot.min.js' ,disposition:'head' , bundle:'app'
resource url: 'jquery.jqplot/jquery.jqplot.min.css' ,disposition:'head' , bundle:'app'
resource url: 'jquery.jqplot/plugins/jqplot.dateAxisRenderer.min.js' ,disposition:'head' , bundle:'app'
resource url: 'jquery.jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js' ,disposition:'head' , bundle:'app'
resource url: 'jquery.jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js' ,disposition:'head' , bundle:'app'
resource url: 'jquery.jqplot/plugins/jqplot.canvasTextRenderer.min.js' ,disposition:'head' , bundle:'app'
resource url: 'jquery.jqplot/plugins/jqplot.cursor.min.js' ,disposition:'head' , bundle:'app'
resource url: 'jquery.jqplot/plugins/jqplot.bubbleRenderer.min.js' ,disposition:'head' , bundle:'app'
resource url: 'jquery.jqplot/plugins/jqplot.categoryAxisRenderer.min.js' ,disposition:'head' , bundle:'app'
}
在您要使用 jqplog 的页面上,只需包含可视化模块。
<r:require modules="visualization"/>