Setting Dates for a Visualization [Reactjs]









up vote
0
down vote

favorite












So I am using Chart.js for my data visualization. And the visualization is being made with this data:



var productionData = 
labels: ["10-15-2018", "10-16-2018", "10-17-2018", "10-18-2018", "10-19-2018", "10-20-2018"],

datasets: [producedData, defectsData, qiData, safetyData, workerData, overtimeData, downtimeData]
;


This currently, displays data for all dates from 10-15-2018 to 10-20-2018 but I want to be able to take subsets like persay 10-16-2018 to 10-19-2018.



I have already added two date textfields that a user will use so they can only see data between the two selected dates that they chose (inclusive).



example of textfield:



 <Grid item xs=6 style= marginTop: 10, marginBottom: 10 align="center">
<TextField
id="initialDate"
label="Initial Date"
type="date"
defaultValue="2018-10-15"
/>
</Grid>


However, I am unsure as to how to implement that. Is there a way to iterate through each of the dates between the two selected dates, place them in an and then add them to the 'labels' part of the visualization configuration?



what are yalls thoughts? If you need more info, feel free to ask!










share|improve this question



























    up vote
    0
    down vote

    favorite












    So I am using Chart.js for my data visualization. And the visualization is being made with this data:



    var productionData = 
    labels: ["10-15-2018", "10-16-2018", "10-17-2018", "10-18-2018", "10-19-2018", "10-20-2018"],

    datasets: [producedData, defectsData, qiData, safetyData, workerData, overtimeData, downtimeData]
    ;


    This currently, displays data for all dates from 10-15-2018 to 10-20-2018 but I want to be able to take subsets like persay 10-16-2018 to 10-19-2018.



    I have already added two date textfields that a user will use so they can only see data between the two selected dates that they chose (inclusive).



    example of textfield:



     <Grid item xs=6 style= marginTop: 10, marginBottom: 10 align="center">
    <TextField
    id="initialDate"
    label="Initial Date"
    type="date"
    defaultValue="2018-10-15"
    />
    </Grid>


    However, I am unsure as to how to implement that. Is there a way to iterate through each of the dates between the two selected dates, place them in an and then add them to the 'labels' part of the visualization configuration?



    what are yalls thoughts? If you need more info, feel free to ask!










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      So I am using Chart.js for my data visualization. And the visualization is being made with this data:



      var productionData = 
      labels: ["10-15-2018", "10-16-2018", "10-17-2018", "10-18-2018", "10-19-2018", "10-20-2018"],

      datasets: [producedData, defectsData, qiData, safetyData, workerData, overtimeData, downtimeData]
      ;


      This currently, displays data for all dates from 10-15-2018 to 10-20-2018 but I want to be able to take subsets like persay 10-16-2018 to 10-19-2018.



      I have already added two date textfields that a user will use so they can only see data between the two selected dates that they chose (inclusive).



      example of textfield:



       <Grid item xs=6 style= marginTop: 10, marginBottom: 10 align="center">
      <TextField
      id="initialDate"
      label="Initial Date"
      type="date"
      defaultValue="2018-10-15"
      />
      </Grid>


      However, I am unsure as to how to implement that. Is there a way to iterate through each of the dates between the two selected dates, place them in an and then add them to the 'labels' part of the visualization configuration?



      what are yalls thoughts? If you need more info, feel free to ask!










      share|improve this question















      So I am using Chart.js for my data visualization. And the visualization is being made with this data:



      var productionData = 
      labels: ["10-15-2018", "10-16-2018", "10-17-2018", "10-18-2018", "10-19-2018", "10-20-2018"],

      datasets: [producedData, defectsData, qiData, safetyData, workerData, overtimeData, downtimeData]
      ;


      This currently, displays data for all dates from 10-15-2018 to 10-20-2018 but I want to be able to take subsets like persay 10-16-2018 to 10-19-2018.



      I have already added two date textfields that a user will use so they can only see data between the two selected dates that they chose (inclusive).



      example of textfield:



       <Grid item xs=6 style= marginTop: 10, marginBottom: 10 align="center">
      <TextField
      id="initialDate"
      label="Initial Date"
      type="date"
      defaultValue="2018-10-15"
      />
      </Grid>


      However, I am unsure as to how to implement that. Is there a way to iterate through each of the dates between the two selected dates, place them in an and then add them to the 'labels' part of the visualization configuration?



      what are yalls thoughts? If you need more info, feel free to ask!







      reactjs date uitextfield






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 9 at 19:59

























      asked Nov 9 at 19:52









      DevAllanPer

      6110




      6110



























          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',
          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%2f53232442%2fsetting-dates-for-a-visualization-reactjs%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232442%2fsetting-dates-for-a-visualization-reactjs%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

          How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

          Syphilis

          Darth Vader #20