Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showLegend = {false} does not hide legend #14

Open
gordonwoon opened this issue Feb 24, 2016 · 6 comments
Open

showLegend = {false} does not hide legend #14

gordonwoon opened this issue Feb 24, 2016 · 6 comments

Comments

@gordonwoon
Copy link

I am trying to hide the legend as my data is pretty huge and it occupies half of the container. Are there any other ways to disable it?

  <PieTooltip
    data= {this.state.data}
    width= {width}
    height= {height}
    chartSeries= {chartSeries}
    showLegend = {false}
    margins= {margins}
    value = {value}
    name = {name}
  />
@freethejazz
Copy link

freethejazz commented Jun 13, 2016

@gordonwoon This is currently working for me. Must have gotten fixed in the last few months?

@lizmallalieu
Copy link

@gordonwoon I am running into the same problem (with react-d3-basic v. 1.6.11 and react-d3-tooltip v. 1.4.14). Did you ever find a solution?

@gordonwoon
Copy link
Author

@lizmallalieu nope, didn't work worked with regards to this library. i switched over to creating a pure d3js file and merge it with react components manually. D3js can handle animations much better than react-d3

@samuelhalim
Copy link

@freethejazz Did you try that for react-d3-tooltip? I checked the commonProps.js and there's no showLegend property over there.

@aureustaurus
Copy link

aureustaurus commented Jul 21, 2016

Hi. I have the same problem. Legend create every time and doesn't look at option legendShow.
During create legend no one condition, just: _react2.default.createElement(_reactD3Core.Legend, this.props)

Maybe insert something like this (example for BarGroupTooltip):
` _createClass(BarGroupTooltip, [{
key: 'render',
value: function render() {
var _props = this.props;
var width = _props.width;
var height = _props.height;

  var showLegend = _props.showLegend;
  var legend = null;
  if (showLegend) {
    legend = _react2.default.createElement(_reactD3Core.Legend, this.props);
  }

  return _react2.default.createElement(
    'div',
    null,
    _react2.default.createElement(
      _tooltip2.default,
      _extends({}, this.props, this.state),
      this.props.children
    ),
    legend,
    _react2.default.createElement(
      _reactD3Shape.Chart,
      _extends({}, this.props, this.state),
      _react2.default.createElement(_barGroup2.default, _extends({}, this.props, this.state, {
        onMouseOver: this.mouseOver.bind(this),
        onMouseOut: this.mouseOut.bind(this)
      }))
    )
  );}}]);`

I apply it and it's working for me. Can you commit something like it?

@freethejazz
Copy link

@samuel-halim95 You're absolutely right. Not sure how I mixed up repositories when posting this comment. I'm going to edit my original comment so people don't get thrown off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants