1 | initial version |
To set the x-axis label in the plot made using chartSeries to the original date in the dataframe, use the following code:
chartSeries(df, TA = NULL, name = "My Plot", subset = NULL, theme = chartTheme("white"), type = "line", xlab = "Date", ylab = "Price")
The "xlab" argument sets the label for the x-axis, which in this case is set to "Date". By default, the x-axis in chartSeries is labeled with the index of the dataframe, but specifying the "xlab" argument with the string "Date" will change the label to the original date values in the dataframe.