R highcharter graphic x axis 1 jan 1970












0















I am trying to plot a dataframe that has two columns in r that have the following format:



Col1-----name:"Date"-----class:"Date"----example: 2001-01-01
Col2-----name:TC---------class:"Numeric"----example:"4.50"



Here is a summary of the dataframe i want to plot:



enter image description here



enter image description here



In order to plot the dataframe i am using the following command:



library(highcharter)
####################
#TC_df$fecha=as.numeric(as.POSIXct(TC_df$fecha))
####################
highchart(type="stock")%>%
hc_title(text = "Tipo de cambio") %>%
hc_subtitle(text = "ARS/USD y dolar sombra ") %>%
hc_xAxis(type = "Datetime", showLastLabel = TRUE,dateTimeLabelFormats =
list(day = "%d", month="%b",year="%y"))%>%
#hc_xAxis(categories = TC_df$fecha)%>%
hc_add_series(TC_df$TC, name = "reservas",type="line",color="green")
#hc_add_series(TC_df$dolarsombra, name = "USD
Sombra",type="line",color="blue")


The result I am having has the problem that dates in the x-axis are all on 1 January 1970 as this image shows:



enter image description here



Thanks in advance, so far this is my first post in stackoverflow, glad to receive some help from the community.










share|improve this question























  • Could you make your problem reproducible by sharing a sample of your data so others can help (please do not use str(), head() or screenshot)? You can use the reprex and datapasta packages to assist you with that. See also Help me Help you & How to make a great R reproducible example?

    – Tung
    Nov 26 '18 at 5:31











  • Hello sorry for the delay. End of year has been a mess for me. Here i add link to the csv file with the data and also the part of the code that generates the highcharter plot.

    – Martin Castellan
    Dec 27 '18 at 1:20











  • drive.google.com/open?id=1KfMmHInj13vbBET-NchnHjBGkTErPy4z

    – Martin Castellan
    Dec 27 '18 at 12:11











  • drive.google.com/open?id=1zl5uC5V_yVcvRSyg633ztfG401sHpl6c

    – Martin Castellan
    Dec 27 '18 at 12:11
















0















I am trying to plot a dataframe that has two columns in r that have the following format:



Col1-----name:"Date"-----class:"Date"----example: 2001-01-01
Col2-----name:TC---------class:"Numeric"----example:"4.50"



Here is a summary of the dataframe i want to plot:



enter image description here



enter image description here



In order to plot the dataframe i am using the following command:



library(highcharter)
####################
#TC_df$fecha=as.numeric(as.POSIXct(TC_df$fecha))
####################
highchart(type="stock")%>%
hc_title(text = "Tipo de cambio") %>%
hc_subtitle(text = "ARS/USD y dolar sombra ") %>%
hc_xAxis(type = "Datetime", showLastLabel = TRUE,dateTimeLabelFormats =
list(day = "%d", month="%b",year="%y"))%>%
#hc_xAxis(categories = TC_df$fecha)%>%
hc_add_series(TC_df$TC, name = "reservas",type="line",color="green")
#hc_add_series(TC_df$dolarsombra, name = "USD
Sombra",type="line",color="blue")


The result I am having has the problem that dates in the x-axis are all on 1 January 1970 as this image shows:



enter image description here



Thanks in advance, so far this is my first post in stackoverflow, glad to receive some help from the community.










share|improve this question























  • Could you make your problem reproducible by sharing a sample of your data so others can help (please do not use str(), head() or screenshot)? You can use the reprex and datapasta packages to assist you with that. See also Help me Help you & How to make a great R reproducible example?

    – Tung
    Nov 26 '18 at 5:31











  • Hello sorry for the delay. End of year has been a mess for me. Here i add link to the csv file with the data and also the part of the code that generates the highcharter plot.

    – Martin Castellan
    Dec 27 '18 at 1:20











  • drive.google.com/open?id=1KfMmHInj13vbBET-NchnHjBGkTErPy4z

    – Martin Castellan
    Dec 27 '18 at 12:11











  • drive.google.com/open?id=1zl5uC5V_yVcvRSyg633ztfG401sHpl6c

    – Martin Castellan
    Dec 27 '18 at 12:11














0












0








0








I am trying to plot a dataframe that has two columns in r that have the following format:



Col1-----name:"Date"-----class:"Date"----example: 2001-01-01
Col2-----name:TC---------class:"Numeric"----example:"4.50"



Here is a summary of the dataframe i want to plot:



enter image description here



enter image description here



In order to plot the dataframe i am using the following command:



library(highcharter)
####################
#TC_df$fecha=as.numeric(as.POSIXct(TC_df$fecha))
####################
highchart(type="stock")%>%
hc_title(text = "Tipo de cambio") %>%
hc_subtitle(text = "ARS/USD y dolar sombra ") %>%
hc_xAxis(type = "Datetime", showLastLabel = TRUE,dateTimeLabelFormats =
list(day = "%d", month="%b",year="%y"))%>%
#hc_xAxis(categories = TC_df$fecha)%>%
hc_add_series(TC_df$TC, name = "reservas",type="line",color="green")
#hc_add_series(TC_df$dolarsombra, name = "USD
Sombra",type="line",color="blue")


The result I am having has the problem that dates in the x-axis are all on 1 January 1970 as this image shows:



enter image description here



Thanks in advance, so far this is my first post in stackoverflow, glad to receive some help from the community.










share|improve this question














I am trying to plot a dataframe that has two columns in r that have the following format:



Col1-----name:"Date"-----class:"Date"----example: 2001-01-01
Col2-----name:TC---------class:"Numeric"----example:"4.50"



Here is a summary of the dataframe i want to plot:



enter image description here



enter image description here



In order to plot the dataframe i am using the following command:



library(highcharter)
####################
#TC_df$fecha=as.numeric(as.POSIXct(TC_df$fecha))
####################
highchart(type="stock")%>%
hc_title(text = "Tipo de cambio") %>%
hc_subtitle(text = "ARS/USD y dolar sombra ") %>%
hc_xAxis(type = "Datetime", showLastLabel = TRUE,dateTimeLabelFormats =
list(day = "%d", month="%b",year="%y"))%>%
#hc_xAxis(categories = TC_df$fecha)%>%
hc_add_series(TC_df$TC, name = "reservas",type="line",color="green")
#hc_add_series(TC_df$dolarsombra, name = "USD
Sombra",type="line",color="blue")


The result I am having has the problem that dates in the x-axis are all on 1 January 1970 as this image shows:



enter image description here



Thanks in advance, so far this is my first post in stackoverflow, glad to receive some help from the community.







r highcharts r-highcharter






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 25 '18 at 13:19









Martin CastellanMartin Castellan

22




22













  • Could you make your problem reproducible by sharing a sample of your data so others can help (please do not use str(), head() or screenshot)? You can use the reprex and datapasta packages to assist you with that. See also Help me Help you & How to make a great R reproducible example?

    – Tung
    Nov 26 '18 at 5:31











  • Hello sorry for the delay. End of year has been a mess for me. Here i add link to the csv file with the data and also the part of the code that generates the highcharter plot.

    – Martin Castellan
    Dec 27 '18 at 1:20











  • drive.google.com/open?id=1KfMmHInj13vbBET-NchnHjBGkTErPy4z

    – Martin Castellan
    Dec 27 '18 at 12:11











  • drive.google.com/open?id=1zl5uC5V_yVcvRSyg633ztfG401sHpl6c

    – Martin Castellan
    Dec 27 '18 at 12:11



















  • Could you make your problem reproducible by sharing a sample of your data so others can help (please do not use str(), head() or screenshot)? You can use the reprex and datapasta packages to assist you with that. See also Help me Help you & How to make a great R reproducible example?

    – Tung
    Nov 26 '18 at 5:31











  • Hello sorry for the delay. End of year has been a mess for me. Here i add link to the csv file with the data and also the part of the code that generates the highcharter plot.

    – Martin Castellan
    Dec 27 '18 at 1:20











  • drive.google.com/open?id=1KfMmHInj13vbBET-NchnHjBGkTErPy4z

    – Martin Castellan
    Dec 27 '18 at 12:11











  • drive.google.com/open?id=1zl5uC5V_yVcvRSyg633ztfG401sHpl6c

    – Martin Castellan
    Dec 27 '18 at 12:11

















Could you make your problem reproducible by sharing a sample of your data so others can help (please do not use str(), head() or screenshot)? You can use the reprex and datapasta packages to assist you with that. See also Help me Help you & How to make a great R reproducible example?

– Tung
Nov 26 '18 at 5:31





Could you make your problem reproducible by sharing a sample of your data so others can help (please do not use str(), head() or screenshot)? You can use the reprex and datapasta packages to assist you with that. See also Help me Help you & How to make a great R reproducible example?

– Tung
Nov 26 '18 at 5:31













Hello sorry for the delay. End of year has been a mess for me. Here i add link to the csv file with the data and also the part of the code that generates the highcharter plot.

– Martin Castellan
Dec 27 '18 at 1:20





Hello sorry for the delay. End of year has been a mess for me. Here i add link to the csv file with the data and also the part of the code that generates the highcharter plot.

– Martin Castellan
Dec 27 '18 at 1:20













drive.google.com/open?id=1KfMmHInj13vbBET-NchnHjBGkTErPy4z

– Martin Castellan
Dec 27 '18 at 12:11





drive.google.com/open?id=1KfMmHInj13vbBET-NchnHjBGkTErPy4z

– Martin Castellan
Dec 27 '18 at 12:11













drive.google.com/open?id=1zl5uC5V_yVcvRSyg633ztfG401sHpl6c

– Martin Castellan
Dec 27 '18 at 12:11





drive.google.com/open?id=1zl5uC5V_yVcvRSyg633ztfG401sHpl6c

– Martin Castellan
Dec 27 '18 at 12:11












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53467874%2fr-highcharter-graphic-x-axis-1-jan-1970%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53467874%2fr-highcharter-graphic-x-axis-1-jan-1970%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'