roengle / VexInfo

Uses VexDB API to read statistics different teams competing at a tournament to input into a Google Sheet.
1 stars 0 forks source link

TODO: Set column length for specified columns #31

Closed roengle closed 4 years ago

roengle commented 4 years ago

If possible from within the API, scale the columns of the sheet to be able to fit the data. Currently, things looks squished together, in which the columns must be manually scaled.

roengle commented 4 years ago

See https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#autoresizedimensionsrequest

roengle commented 4 years ago

See below for the format of the request

image

roengle commented 4 years ago

See code below for centering all text. All text must be centered before resizing dimensions

{ "requests": [ { "repeatCell": { "range": { "sheetId": 0, "startColumnIndex": 0, "endColumnIndex": 20, "startRowIndex": 0 }, "cell": { "userEnteredFormat": { "horizontalAlignment": "CENTER", "verticalAlignment": "MIDDLE" } }, "fields": "userEnteredFormat(horizontalAlignment,verticalAlignment)" } } ] }

roengle commented 4 years ago

done (294b3db)

roengle commented 4 years ago

JSON for whole request

{
  "requests": [
    {
      "autoResizeDimensions": {
        "dimensions": {
          "dimension": "COLUMNS",
          "startIndex": 0,
          "endIndex": 20,
          "sheetId": 0
        }
      },
      "repeatCell": {
        "range": {
          "sheetId": 0,
          "startColumnIndex": 0,
          "endColumnIndex": 20,
          "startRowIndex": 0
        },
        "cell": {
          "userEnteredFormat": {
            "horizontalAlignment": "CENTER",
            "verticalAlignment": "MIDDLE"
          }
        },
        "fields": "userEnteredFormat(horizontalAlignment,veritcalAlignment)"
      }
    }
  ]
}