简体   繁体   English

使用JfreeChart XYLineChart自定义x轴

[英]Customize x axis with JfreeChart XYLineChart

I'm displaying the results of a clustering operation on a XYLineChart using JFreeChart . 我正在使用JFreeChartXYLineChart上显示集群操作的结果。 For now the plot I get is this one: 现在我得到的情节是这个:

图片

I need to change the x axis in order to get this display: 我需要更改x轴以获得此显示:

图片

So basically I first need to get rid of the tick and numbers (this I already searched and found a way to manage how to do it). 因此,基本上,我首先需要除去刻度和数字(我已经进行了搜索,找到了一种管理操作方法的方法)。 The problem for me is to add my own custom String values on the x axis AND to have these positionned at specific position. 我的问题是在x轴上添加我自己的自定义String值,并将这些值定位在特定位置。 I already have an arraylist with the Strings and another one with the position values, no need to calculate them, i just want to know how to use them with the plot. 我已经有了一个包含字符串的arraylist和另一个具有位置值的数组,无需计算它们,我只想知道如何在绘图中使用它们。

Thank you in advance and, as usual, please tell me if my explanation needs to be clarified. 在此先感谢您,照常告诉我是否需要澄清我的解释。

in order to change the content of the display, you need to change your query to have the output you like to see. 为了更改显示的内容,您需要更改查询以具有希望看到的输出。 to change the position you may need to use something like: categoryPlot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_90); 要更改位置,您可能需要使用类似以下内容的方法:categoryPlot.getDomainAxis()。setCategoryLabelPositions(CategoryLabelPositions.UP_90);

you need to show some of your code so that you can get the proper advice 您需要显示一些代码,以便获得正确的建议

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM