From 7affc11edd4185f619cef7e5e652f41008c2e418 Mon Sep 17 00:00:00 2001 From: Eric Hung Date: Wed, 3 Aug 2016 15:20:04 +0800 Subject: [PATCH] Fix subsetting bug of minor ticks on x-axis When reChart is called to draw subset series, minor ticks on xycoords$x do not change with the subset sereis. Fix xycoords$x to be xycoords$x[1:NROW(xsubset)] in the x-axis expression. --- R/chartSeries.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/chartSeries.R b/R/chartSeries.R index de3dc423..9c03344e 100644 --- a/R/chartSeries.R +++ b/R/chartSeries.R @@ -540,7 +540,7 @@ function(x, # change minor ticks to be downward exp <- expression(if (NROW(xdata[xsubset]) < 400) { - axis(1, at = xycoords$x, labels = FALSE, col = theme$grid2, + axis(1, at = xycoords$x[1:NROW(xsubset)], labels = FALSE, col = theme$grid2, col.axis = theme$grid2, tcl = -0.4) }) exp <- structure(exp, frame = 1)