I am using React Vis to create a simple Graph. This is my code:
import React from 'react';
import '../../../node_modules/react-vis/dist/style.css';
import {XYPlot, VerticalBarSeries} from 'react-vis';
const myData = [
{x: 'A', y: 10},
{x: 'B', y: 5},
{x: 'C', y: 15}
]
export const Chart = () => {
return (
<XYPlot height={500} width={500}>
<VerticalBarSeries data={myData} />
</XYPlot>
)
};
export default Chart;
I receive this error message:
Received NaN for the `x` attribute. If this is expected, cast the value to a string."
When I change the x values in myData to ints, it works, but I need them as strings. The documentation clearly states that this should work: