在JFreeChart的条形图上的X轴标签旁边添加图像 [英] Add an Image next to a X-axis label on a JFreeChart's barchart
问题描述
我需要使用JFreeChart库创建的条形图。
I have requirement for the barchart which I have created using JFreeChart libraries.
我用一个例子说明了这一点。让我们说:
我在X轴(学生)上绘制了John,Mark,Louis和Keith,并在Y轴上绘制了各自的标记。我为每个学生使用三个不同的酒吧来展示他们各自的英语,科学和数学标记。
I am illustrating this using an example. Lets say: I have plotted "John", "Mark", "Louis" and "Keith" on the X-axis (Students) and their respective marks on the Y-axis. I am using three different bars for each of the students to show their respective English, Science, and Maths marks.
让我们说,科学的权重最大,因此获得科学最高奖的学生将获得金奖。 数学中最高的会给学生一个白银,而英语最高的会给他一个铜奖
Lets say, Science weigh the most, hence a student getting highest in Science would get a "Gold-Medal". Highest in "Maths" would fetch a student a "Silver", and highest in English would fetch him a "Bronze"
我想放一个小图像(黄金,在每个科目中获得最高分的学生的标签旁边的银色或青铜色。一个特定的学生(显然)可以获得所有奖牌。可以这样做(或类似的事情)。
I want to put a small image (gold, silve or bronze) beside the label of the student who has got the highest marks in each of the subjects. A particular student (obviously) can get all the medals. Can this (or a thing similar to this) be done.
我正在使用JFreeChart的ChartFactory.createBarChart(...)api。我能够正确绘制图形,但坚持上述要求。
I am using JFreeChart's ChartFactory.createBarChart(...) api for this. I am able to plot the graph correctly but stuck with the above requirement.
谢谢!
推荐答案
你可能会看一下其中一个 org.jfree .chart.annotations
,例如 XYDataImageAnnotation
, XYDrawableAnnotation
或 XYImageAnnotation
。
You might look at one of the org.jfree.chart.annotations
such as XYDataImageAnnotation
, XYDrawableAnnotation
or XYImageAnnotation
.
这篇关于在JFreeChart的条形图上的X轴标签旁边添加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!