Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Vega number locale should be consistent with Kibana's format:number:Locale #79

Open
bphenriques opened this issue Aug 9, 2018 · 1 comment

Comments

@bphenriques
Copy link

bphenriques commented Aug 9, 2018

Hello,

By default Vega uses American English Locale (https://vega.github.io/vega/docs/api/locale/), however it would be great if that Locale would be consistent with Kibana (format:number:Locale in advanced settings - source) when using "formatType": "number".

Steps to reproduce:

  • Set format:number:Locale to pt-pt (uses )
  • Create the following Vega visualization:
{
  "$schema": "https://vega.github.io/schema/vega/v3.3.1.json",

  "data": [
    {
      "name": "table",
      "values": [
        {"category": "A", "amount": 2800.32},
        {"category": "B", "amount": 5500.54},
        {"category": "C", "amount": 4300.12}
      ]
    }
  ],
  "scales": [
    {
      "name": "xscale",
      "type": "band",
      "domain": {"data": "table", "field": "category"},
      "range": "width",
      "padding": 0.05,
      "round": true
    },
    {
      "name": "yscale",
      "domain": {"data": "table", "field": "amount"},
      "nice": true,
      "range": "height"
    }
  ],

  "axes": [
    { "orient": "bottom", "scale": "xscale" },
    { "orient": "left", "scale": "yscale", "formatType": "number", "format": "$.3s" }
  ],

  "marks": [
    {
      "type": "rect",
      "from": {"data":"table"},
      "encode": {
        "enter": {
          "x": {"scale": "xscale", "field": "category"},
          "width": {"scale": "xscale", "band": 1},
          "y": {"scale": "yscale", "field": "amount"},
          "y2": {"scale": "yscale", "value": 0}
        },
        "update": {
          "fill": {"value": "steelblue"}
        }
      }
    }
  ]
}

image

Expected results: The currency sign should be and not $:

Regards,
Bruno

@marcopesani
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants