使用 Jfreechart 绘制 3D 图表

发布于 2024-07-26 18:26:30 字数 188 浏览 9 评论 0原文

是否可以使用 JfreeChart 绘制 3D 图表,如以下链接所示。如果可能,任何人都可以提供一些提示和一些代码片段,说明 Plot 的哪些参数可用于执行此操作。

链接文本

Is it possible to draw a 3D chart using JfreeChart like in the following link.If possible can anyone give some hints and some snippets of code on what parameters of Plot can be used to do this.

link text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不气馁 2024-08-02 18:26:30

虽然看起来不完全相同,但这是可能的。 最简单的方法是创建一个数据集(org.jfree.data.general.PieDataset 的后代)并使用 org.jfree.chart.ChartFactory 方法之一:

PieDataset data = new DefaultPieDataset();
data.setValue("Section1", 30);
data.setValue("Section2", 60);
data.setValue("Section3", 120);
JFreeChart pieChart = ChartFactory.createPieChart3D(
 "My Pie Chart", // title
 data,           // data set
 true,           // draw a legend
 true,           // show tooltips over sections
 false);         // do not generate image map with URLs

您可以然后通过 pieChart 方法进一步自定义您的图表。 例如,以下是如何分解一个饼图部分:

 PiePlot plot = (PiePlot) pieChart.getPlot();
 plot.setExplodePercent("Section2", 0.25);

It's possible though it won't look exactly the same. The easiest way is to create a dataset (descendant of org.jfree.data.general.PieDataset) and use one of org.jfree.chart.ChartFactory methods:

PieDataset data = new DefaultPieDataset();
data.setValue("Section1", 30);
data.setValue("Section2", 60);
data.setValue("Section3", 120);
JFreeChart pieChart = ChartFactory.createPieChart3D(
 "My Pie Chart", // title
 data,           // data set
 true,           // draw a legend
 true,           // show tooltips over sections
 false);         // do not generate image map with URLs

You can then further customize your chart through pieChart methods. For example, here's how to explode one pie section:

 PiePlot plot = (PiePlot) pieChart.getPlot();
 plot.setExplodePercent("Section2", 0.25);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文