| | |
| | | } |
| | | |
| | | @Test |
| | | void scalesLineChartHeightForBetterVerticalSeparation() throws Exception { |
| | | HolidayTrendChartService service = new HolidayTrendChartService(); |
| | | HolidayTrendChartService.ChartSeries series = new HolidayTrendChartService.ChartSeries(); |
| | | series.setName("测试"); |
| | | series.setValues(java.util.Arrays.asList( |
| | | new BigDecimal("1.00"), new BigDecimal("2.00"), new BigDecimal("3.00"))); |
| | | |
| | | byte[] png = service.lineChart("万人次", |
| | | java.util.Collections.singletonList(series), false, 1100, 590); |
| | | BufferedImage image = ImageIO.read(new ByteArrayInputStream(png)); |
| | | |
| | | assertNotNull(image); |
| | | assertEquals(HolidayTrendChartService.scaleLineChartHeight(590), image.getHeight()); |
| | | } |
| | | |
| | | @Test |
| | | void rendersHigherPrecisionLineLabelsWhenRequested() { |
| | | HolidayTrendChartService service = new HolidayTrendChartService(); |
| | | HolidayTrendChartService.ChartSeries congestion = new HolidayTrendChartService.ChartSeries(); |