See the warning on the top right? If you remember, we showed that if you inspect the console in the browser's Developer Tools, you get the following:
Warning: some data associated with the x scale are strings that appear to be numbers. If these strings represent numbers, you should parse or coerce them to numbers. Numbers are typically associated with a "linear" scale rather than a "band" scale. If you want to treat this data as ordinal, you can specify the interval of the x scale (e.g., 1 for integers), or you can suppress this warning by setting the type of the x scale to "band".
Try to address that.
The chart has a few issues, similar to the ones we discussed when we reviewed Rafa's chart:
– The y-axis is very off. Since it's treating "Model Year" as a number, it's adding up the years. For Audi, the bar height is 2016 + 2019 + 2020 = 6,055, which makes no sense.
– To do a count, which seems to be your intention, you should have transformed the data before, or use Plot's bin transform. (The bars would look similar to what they look like now though —guess why?)
– The categorical color scale is not applying because you're giving it the wrong variable name.
– The barY mark doesn't have an r channel, which sets the radius of marks like dot.