GWT 图表 GChart 实例
来源:互联网 发布:c net编程 编辑:程序博客网 时间:2024/06/04 00:48
- First download the jar from the project home page http://code.google.com/p/gchart/
- Put it under war/WEB-INF/lib and add the gchart.jar to your classpath
- Create a Web Application project called it GChart-samples (I assume you have Google Eclipse Plugin and follow the basic steps from here)
- This step is for make-up, find GChart_samples.html under war/WEB-INF and clear the part between <body> tags.
- Open GChart_samples.gwt.xml and add the following line
<inherits name='com.googlecode.gchart.GChart'/>
- Create a class in client folder called FirstChart and change it as the following
package com.dogan.kaya.client;import com.googlecode.gchart.client.GChart;public class FirstChart extends GChart{public FirstChart(){setChartSize(350, 350);addCurve();int[] data = { 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };for (int i = 0; i < data.length; i++){getCurve().addPoint(i + 1, data[i]);}//curve customizationgetCurve().getSymbol().setHeight(10);getCurve().getSymbol().setWidth(10);getCurve().getSymbol().setBorderColor("black");getCurve().getSymbol().setBorderWidth(3);getCurve().getSymbol().setSymbolType(SymbolType.LINE);getCurve().getSymbol().setFillThickness(2);getCurve().getSymbol().setFillSpacing(0);//chart customizationgetXAxis().setAxisMin(1);getXAxis().setAxisMax(12);getXAxis().setTickCount(12);getXAxis().setHasGridlines(false);getXAxis().setTickLocation(TickLocation.CENTERED);getXAxis().setTickLabelFontSize(10);getYAxis().setAxisMin(0);getYAxis().setAxisMax(12);//to get inteter values on y axis, be careful//about the number of intervals it can be trickygetYAxis().setTickCount(13);getYAxis().setTicksPerLabel(2);getYAxis().setHasGridlines(false);getYAxis().setTickLabelFontSize(10);//update();}}
- Open GChart_samples class and change it like the following
package com.dogan.kaya.client;import com.google.gwt.core.client.EntryPoint;import com.google.gwt.user.client.ui.RootPanel;public class GChart_samples implements EntryPoint{public void onModuleLoad(){RootPanel.get().add(new FirstChart());//这句比较灵活}}
- GWT 图表 GChart 实例
- gchart:基于google图表API的jquery组件全攻略:1、入门
- gchart:基于google图表API的jquery组件全攻略:1、入门
- GWT
- GWT
- GWT
- GWT
- gwt
- GWT
- GWT
- GWT
- sliverLight 图表实例
- 创建图表实例 统计图
- JFreeChart 图表 实例
- jfreechart 图表生成实例
- Highcharts js图表实例
- highcharts 图表操作实例
- swt动态图表实例
- Android 优秀开源项目
- mysql替代方案-mariadb
- mysql使用的命令
- MyEclipse8.5配置Hibernate
- 警告The argument of type String[] should explicitly be cast to Object[] for the invocation of the vara
- GWT 图表 GChart 实例
- Zend安装OpenExplorer插件
- CentOS 6下编译Bootstrap 2.3.0
- ArcGIS.Server.9.3和ArcGIS API for JavaScript实现Toc功能(二)
- Plugin-x在Android下的整合
- easyui datagrid 让某行复选框置灰不能选
- MATLAB多种函数
- LINUX下挂载WINDOWS
- 智能dns系统以及dns教程