JAVAFX图表:在类别轴上设置原点 [英] JAVAFX CHARTS: Setting origin point on category axis

查看:437
本文介绍了JAVAFX图表:在类别轴上设置原点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在javafx折线图中为类别轴添加零点.在图像中,我想要一些"T0"来表示x轴上的原点的零标记,以便可以将y轴上的点标记为图表上的点. 示例折线图(看起来像条形图!)

I am in need to add a zero point for category axis in javafx line chart. In the image I want some "T0" to represent the zero mark of origin on the x axis, so that I can mark point on y axis as on the chart. sample line chart ( looks like bar chart !)

推荐答案

我不清楚您要问的是什么,但是如果您想要x轴左端的像素坐标,则可以执行

I'm not completely clear what you're asking, but if you want the pixel coordinates of the left end of the x-axis, you can do

Category xAxis = ... ;

// ...

double leftEnd = xAxis.getDisplayPosition(value0) - xAxis.getCategorySpacing();

其中value0是第一个数据点的x值.

where value0 is the x-value of the first data point.

这篇关于JAVAFX图表:在类别轴上设置原点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆