您好,我正在尝试显示 bmi 图的矩形。
但是矩形将在滚动事件中被剪切和隐藏
编辑:绿色矩形应该是
点 A(-infinity, 21) 点 B(+infinity, 21) 点 C(+infinity, 26) 点 D(-infinity, 26)
但是 B 点是 (12.10, 21) //12.10 是日期 12-10-2012
// optimal_range
LineAndPointFormatter optFormat = new LineAndPointFormatter(Color.TRANSPARENT, Color.TRANSPARENT, Color.TRANSPARENT);
XYRegionFormatter rf = new XYRegionFormatter(optimal_color_fill);
RectRegion rr = new RectRegion(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, optimal[0], optimal[1]);
Number xDummy[] = { Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY };
Number yDummy[] = { optimal[1], optimal[1] };
XYSeries optSerie = new SimpleXYSeries(Arrays.asList(xDummy), Arrays.asList(yDummy), "");
mySimpleXYPlot.addSeries(optSerie, optFormat);