- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想制作以小时为周期的蜡烛图(android),并寻找afreeChart 库以供使用。基于 jfreeCharts 的免费图表。
我有一个带有每日周期的烛台示例:
公共(public)静态 OHLCDataset createDataset1() {
Date[] date = new Date[47];
double[] high = new double[47];
double[] low = new double[47];
double[] open = new double[47];
double[] close = new double[47];
double[] volume = new double[47];
int jan = 1;
int feb = 2;
for(int i = 0; i < 47; i++) {
if(i <= 27) {
date[i] = createDate(2001, jan, i+4, 12, 0);
} else {
date[i] = createDate(2001, feb, i-27, 12, 0);
}
high[i] = 45 + Math.random() * 20;
low[i] = high[i] - (Math.random() * 30 + 3);
do {
open[i] = high[i] - Math.random() * (high[i] - low[i]);
close[i] = low[i] + Math.random() * (high[i] - low[i]);
} while(Math.abs(open[i] - close[i]) < 1);
}
return new DefaultHighLowDataset("Series 1", date, high, low, open, close, volume);
}
private static final Calendar calendar = Calendar.getInstance();
/**
* Returns a date using the default locale and timezone.
* @param y the year (YYYY).
* @param m the month (1-12).
* @param d the day of the month.
* @param hour the hour of the day.
* @param min the minute of the hour.
* @return A date.
*/
private static Date createDate(int y, int m, int d, int hour, int min) {
calendar.clear();
calendar.set(y, m - 1, d, hour, min);
return calendar.getTime();
}
DefaultHighLowDataset 不适用于非日期值。我在 Developer Guide Jfreechart 中查看 OHLC 类,但没有找到每小时的方法。如何每小时创建一根蜡烛而不是每个日期期间创建一根蜡烛?也许有人有例子?谢谢!
最佳答案
在 OHLCDataset
的实现中, OHLCSeriesCollection
包括addSeries(OHLCSeries series)
。 OHLCSeries
允许add(RegularTimePeriod period, …)
,RegularTimePeriod
包含子类Hour
。讨论了使用 Hour
的示例 here .
关于java - Jfree :how do CandleStick chart with hour period,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13353070/
我正在使用 Studio 创建 JasperReports 的报告。我需要增加折线图的宽度(默认值太细)。据我所知,JasperReports 使用 Jfeechart 作为图表,我用谷歌搜索了这段代
我正在尝试创建一个新的 JFreeChart,我的项目构建路径中有 JCommon (1.0.22) 和 JFreeChart (1.0.17-demo); 但是,当我尝试创建代码时,在这种情况下;
如何修改 ChartPanel 的 mouseDragged 事件,以便在缩放完成之前/之后进行一些处理? 我有以下图表面板, JFreeChart chart = new JFreeChart(
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我在这里有一个简单的甘特图,它由许多任务组成,就像这样: TaskSeries s1 = new TaskSeries("Planned Tasks"); Task newTask = new Tas
我想在我的饼图中个性化我的数据标签,因为在我的图例中我看到数据=值,在标签中我看到数据=值。我如何才能只看到图例中的名称数据和标签中的值?我绘制图表的代码是这样的: public JfreeC
我想在我的 JFree charts 中使用我的 Axis变成 % 而不是普通数字 有谁知道我如何修改我的代码以实现这种情况。 应该说我的表格已经是百分比了,但它自己的图表不是! 更新 这是我到目前为
我正在尝试使用 jfree 图表库创建一个折线图,我需要显示与折线图中每个索引关联的值,我不能为此使用工具提示,因为我正在将图表转换为图像,是吗一种在每个索引顶部显示值的方法? 谢谢,巴维亚 最佳答案
有没有我们可以找到示例源代码/教程/帮助使用 jfreecharts 的链接?? 谢谢。 最佳答案 如果你仔细观察的话,它们有很多。 http://www.vogella.de/articles/JF
我对java不太了解,但希望以下代码作为小程序运行。请求对此真诚的帮助。 任何人都可以帮助我将此代码作为小程序运行吗?这是 Jfree 图表,我想将它作为小程序运行。请提出建议。 package or
我正在寻找一种在 JFree Chart 创建的图像中插入特定评论/注释的方法。注释可以位于图像 (png) 上的任意位置、图表上方或下方。 有办法做到这一点吗? 最佳答案 要添加文本,addSubt
通过使用 StandardCategoryItemLabelGenerator() 我能够在条形图上显示精确的范围轴值,现在我的问题是我不想显示范围轴值而是我想显示该条形图的其他一些值我该如何实现?
我在我的应用程序中使用 Jfree 图表。国际化非常适合德语、俄语、法语...但在中文、日语中,x 轴和 y 轴文本看起来像方框。如何解决这个问题? 谢谢。 最佳答案 检查下面的链接,它似乎在讨论完全
我正在尝试使用 jfree 图表显示散点图和 XYline 图表。我可以一次展示它们。我有一个组合框,可让您选择要绘制的绘图类型。在此基础上,我必须使用 jfree 图表绘制相应的图。 我有以下代码来
我正在使用 jfree Chart 绘制一些点进行定位。 问题是图表是在灰色表面上绘制的,而不是在我的平面图上绘制的。所以我尝试使用背景图像,但这将图像放在背景中并且无法使用,因为我需要它。 我想用图
我想使用 JFree 在多系列图表中的条形顶部显示标签。请告诉我如何做到这一点? 最佳答案 由于这是一个条形图,添加一个 StandardCategoryItemLabelGenerator 的实例到
如何增加显示颜色的图例键的大小。字体大小由 chart.getLegend().setItemFont(new Font("SansSerif", Font.PLAIN, 12)); 调整 但我找不到
谁能告诉我如何减小 jcommon-1.0.16.jar 和 jfreechart-1.0.13.jar(主要是 jfreechart-1.0.13.jar )可执行文件的大小。我需要减小我的嵌入式产
我是 JFree 的新手。我想知道如何创建数据集,使特定作业的所有操作都具有相同的颜色(例如,O111、O122、O133、O144 具有相同的颜色,机器排列如图 2 所示)。 我尝试使用 TaskS
我在报告中使用 jfree 图表。我想从饼图中删除切片部分: 另外,我想让它以切片值为中心,并在我当前使用的脚本下面提到: import java.awt.Color; import org.jfre
我是一名优秀的程序员,十分优秀!