vega / vega-lite

A concise grammar of interactive graphics, built on Vega.
https://vega.github.io/vega-lite/
BSD 3-Clause "New" or "Revised" License
4.64k stars 603 forks source link

Scatterplot with CSV with null values shows null as 0 #6615

Closed domoritz closed 6 months ago

domoritz commented 4 years ago
{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "data": {"url": "data/penguins_size.csv"},
  "mark": "point",
  "encoding": {
    "x": {
      "field": "body_mass_g",
      "type": "quantitative",
      "scale": {"zero": false}
    },
    "y": {
      "field": "flipper_length_mm",
      "type": "quantitative",
      "scale": {"zero": false}
    },
    "color": {"field": "species", "type": "nominal"},
    "shape": {"field": "species", "type": "nominal"}
  }
}

image

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "data": {
    "url": "data/movies.csv"
  },
  "layer": [
    {
      "mark": {
        "type": "point",
        "filled": true
      },
      "encoding": {
        "x": {
          "field": "Rotten Tomatoes Rating",
          "type": "quantitative"
        },
        "y": {
          "field": "IMDB Rating",
          "type": "quantitative"
        }
      }
    },
    {
      "mark": {
        "type": "line",
        "color": "firebrick"
      },
      "transform": [
        {
          "loess": "IMDB Rating",
          "on": "Rotten Tomatoes Rating"
        }
      ],
      "encoding": {
        "x": {
          "field": "Rotten Tomatoes Rating",
          "type": "quantitative"
        },
        "y": {
          "field": "IMDB Rating",
          "type": "quantitative"
        }
      }
    }
  ]
}

image

domoritz commented 4 years ago

Related pull request https://github.com/vega/vega-lite/pull/4993

ChiaLingWeng commented 6 months ago

It's already fixed at v5.17.0 Open the Chart in the Vega Editor