React-vis: Gridlines not rendering

Created on 25 Apr 2017  路  6Comments  路  Source: uber/react-vis

I don't know what I'm missing here, but for some reason the gridlines don't seem to render with a XY Plot component. Not sure if I need to place the components in a certain order, or specify certain properties for the gridlines.

Here's a preview of what the graph looks like
image

and the ordering of my components.

class Graph extends Component {
  render() {
    return (
      <div className="graph">
        <XYPlot
          width={1100}
          height={300}>
          <HorizontalGridLines />
          <VerticalBarSeries 
            data={impressions}
          />

          <VerticalGridLines />
          <XAxis tickTotal={10} tickSize={3} />

          <YAxis /> 
        </XYPlot>
      </div>
    );
  }
}

Most helpful comment

I know this issue is closed but to avoid other people wasting time (I've been trough the same problem!):
Do not forget to add the stylesheet to your app. There are instructions in the Readme.

All 6 comments

Not sure if we can set a strokewidth property on this, right now there's no width.
image

I was able to get them to show by specifying the line thickness on the css class.

  .rv-xy-plot__grid-lines__line {
    stroke: gray;
    stroke-width: 1;
  }

Would be nice if these were set by default.

I know this issue is closed but to avoid other people wasting time (I've been trough the same problem!):
Do not forget to add the stylesheet to your app. There are instructions in the Readme.

Thanks, @Lobosque. Where is this documented? I'm not seeing the instructions here, which is where I expected to find this kind of information.

for anyone else coming here, like me, i found info on importing the styles here: https://github.com/uber/react-vis/blob/master/docs/getting-started/getting-started.md

i decided to import the styles into my component since it's only needed in one place:

import '../node_modules/react-vis/dist/style.css';

or just:

import 'react-vis/dist/style.css';

It seems mine is loading the styles.css, also I can see in my dev tools the colors. However, this is how my demo graph is showing up.


screen shot 2018-06-19 at 9 45 19 pm

Did anyone have this problem before?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

martoncsikos picture martoncsikos  路  4Comments

zavrick picture zavrick  路  4Comments

kbouaazzi-ds picture kbouaazzi-ds  路  3Comments

gespispace picture gespispace  路  3Comments

ZKruse picture ZKruse  路  4Comments