【问题标题】:Vaadin 6.8 create chart with vaadin add-onsVaadin 6.8 使用 vaadin 插件创建图表
【发布时间】:2014-12-03 03:24:31
【问题描述】:

希望你在你的最后摇摆,但我需要一点帮助。 我正在研究 vaadin portlet,我需要创建一个 vaadin 图表(示例)。 我下载了所需的 jars(vaadin-charts-vaadin6-1.1.7.jar 和 gson-2.2.1.jar)并创建了 申请如下:

@SuppressWarnings("serial")
public class UserloginchartApplication extends Application {

    public void init() {
        Window window = new Window();

        setMainWindow(window);
        Chart chart = new Chart(ChartType.BAR);

        window.setModal(true);
        window.addComponent(chart);
    }
 }

在 tomcat 服务器上编译和部署后,我在 UI 上收到以下错误

Widgetset 不包含 com.vaadin.addon.charts.Chart 的实现。检查它的@ClientWidget 映射、widgetsets GWT 模块描述文件并重新编译你的widgetset。如果您已经下载了 vaadin 附加包,您可能需要参考附加说明。未渲​​染的 UIDL: - 未渲染的 UIDL -com.vaadin.addon.charts.Chart(未找到客户端实现)id=PID3 高度=400px 宽度=100.0% confState={ "chart": { "type": "bar" }, "series": [], “导出”:{“启用”:假 } }

谁能告诉我在liferay中实现/创建vaadin图表的步骤。

提前致谢:

-维卡什

【问题讨论】:

    标签: java charts vaadin add-on vaadin-charts


    【解决方案1】:

    问题是 vaadin.addon.charts 有一些客户端小部件不包含在默认小部件集中,那么您需要重新编译小部件集。如果您使用 Maven 之类的构建收费,您可以这样做:

        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>${vaadin.plugin.version}</version>
            <configuration>
                <gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>
                <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                <!-- <runTarget>mobilemail</runTarget> -->
                <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This way 
                    compatible with Vaadin eclipse plugin. -->
                <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
                <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
                <noServer>true</noServer>
                <!-- Remove draftCompile when project is ready -->
                <draftCompile>false</draftCompile>
                <compileReport>true</compileReport>
                <style>OBF</style>
                <strict>true</strict>
                <runTarget>http://localhost:8080/</runTarget>
            </configuration>
            <executions>
                <execution>
                    <configuration>
                        <!-- if you don't specify any modules, the plugin will find them -->
                        <!-- <modules> <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module> 
                            </modules> <gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath> -->
                    </configuration>
                    <goals>
                        <goal>resources</goal>
                        <goal>update-widgetset</goal>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    

    【讨论】:

    • 谢谢,但我没有使用 maven。我从控制面板重新编译了小部件集,现在我没有遇到上述错误,但我仍然无法在 UI 上看到图表,即使有不是错误或异常。
    • 你用的是什么系统构建?
    • 您好 Skizzo,感谢您的回复。我正在使用 ant build。
    • 有一个脚本可以下载 ant 脚本见Vaadin Download
    猜你喜欢
    • 2018-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-30
    • 1970-01-01
    • 2021-04-01
    相关资源
    最近更新 更多