JAVAFX CHARTS: Setting origin point on category axis

*爱你&永不变心* 提交于 2019-12-25 07:17:21

问题


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 !)


回答1:


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();

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



来源:https://stackoverflow.com/questions/39287063/javafx-charts-setting-origin-point-on-category-axis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!