How to show Last data date on XAxis

20 views
Skip to first unread message

AMK

unread,
Jun 14, 2022, 4:11:58 AMJun 14
to Google Visualization API
I am using Are chart, but it doesnt shows the last data date, but show as per interval.

```javascript
function drawVisualization() {
   $.get("BIC-Daily-Stock-Price.csv", function(csvString) {
      // transform the CSV string into a 2-dimensional array
      var arrayData = $.csv.toArrays(csvString, {onParseValue: $.csv.hooks.castToScalar});

      // this new DataTable object holds all the data
      var data = new google.visualization.arrayToDataTable(arrayData);
      // CAPACITY - En-route ATFM delay - YY - CHART
      var crt_ertdlyYY = new google.visualization.ChartWrapper({
         chartType: 'AreaChart',
         containerId: 'crt_ertdlyYY',
         dataTable: data,
         options:{
            width: 550, height: 350,
            title: '',
            legend: 'bottom',
            titleTextStyle : {color: 'grey', fontSize: 11},
             colors: ["#AB8837"],
            hAxis: {
                  title: 'Date',
                  pointSize: 1,
                  format: 'MM d',
                  title: '',
                  titlePosition: 'none'
                  },
            vAxis: {
               title: 'Fils'
               }
         }
      });
     
      crt_ertdlyYY.draw();
   });
```
CSV File data:
Date,Close
12/01/22,47.5
13/01/22,49.7
16/01/22,49.7
17/01/22,48.9
18/01/22,48.2
19/01/22,48.4
20/01/22,47.3
23/01/22,47.8
24/01/22,47.0
25/01/22,45.6
26/01/22,47.7
27/01/22,46.6
30/01/22,47.0
31/01/22,46.6
01/02/22,45.8
02/02/22,46.4
03/02/22,46.5
06/02/22,45.9
07/02/22,45.9
08/02/22,46.0
09/02/22,47.0
10/02/22,47.0
13/02/22,45.5
14/02/22,45.0
15/02/22,45.4
16/02/22,45.8
17/02/22,45.1
20/02/22,44.5
21/02/22,44.6
22/02/22,45.0
23/02/22,45.4
24/02/22,42.0
02/03/22,43.8
03/03/22,43.9
06/03/22,43.7
07/03/22,43.0
08/03/22,43.1
09/03/22,42.6
10/03/22,43.0
13/03/22,44.4
14/03/22,44.5
15/03/22,44.7
16/03/22,44.3
17/03/22,44.4
20/03/22,45.0
21/03/22,44.8
22/03/22,45.0
23/03/22,46.4
24/03/22,44.5
27/03/22,45.7
28/03/22,45.7
29/03/22,42.9
30/03/22,42.0
31/03/22,42.0
03/04/22,42.4
04/04/22,42.4
05/04/22,41.1
06/04/22,39.4
07/04/22,41.0
10/04/22,41.6
11/04/22,41.5
12/04/22,41.5
13/04/22,38.0
14/04/22,38.7
17/04/22,38.9
18/04/22,38.0
19/04/22,39.5
20/04/22,39.0
21/04/22,37.9
24/04/22,37.0
25/04/22,38.4
26/04/22,37.6
27/04/22,38.8
28/04/22,38.8
05/05/22,39.5
08/05/22,39.0
09/05/22,39.5
10/05/22,38.9
11/05/22,38.1
12/05/22,36.4
16/05/22,35.8
17/05/22,36.6
18/05/22,37.5
19/05/22,35.1
22/05/22,36.4
23/05/22,37.0
24/05/22,35.2
25/05/22,35.9
26/05/22,36.0
29/05/22,36.9
30/05/22,36.7
31/05/22,37.0
01/06/22,36.9
02/06/22,36.7
05/06/22,36.9
06/06/22,36.8
07/06/22,35.1
08/06/22,36.0
09/06/22,34.4
12/06/22,33.8
13/06/22,35.4

How can I show the last date on the x-axis from the data?

Reply all
Reply to author
Forward
0 new messages