uber / react-vis

Data Visualization Components

Home Page:https://uber.github.io/react-vis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HorizontalBarSeries y can't be string

NEsanya opened this issue · comments

In the documentation, the y field says: "Type: (Horizontal Bar Series): string | number". But in practice, the y field can only be a number.
Example:

<XYPlot width={300} height={300}>
  <HorizontalBarSeries
    data={[
      { y: "APPLE", x: 7 },
      { y: "BANANA", x: 10 }
    ]}
  />
</XYPlot>

That code throws many errors on the console. But if we put an int in the y field, then everything will work.

Same goes for VerticalBarSeries, x can't be a string

I think you just need to state xtype to be ordinal, something like this
image