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

Rendering as individual components #11

Open
TRomesh opened this issue Aug 22, 2020 · 1 comment
Open

Rendering as individual components #11

TRomesh opened this issue Aug 22, 2020 · 1 comment

Comments

@TRomesh
Copy link

TRomesh commented Aug 22, 2020

Hi have used this component inside a React card component and this card has been looped through a map. This is how it is rendered

image

Any reason why it is rendered in a stacked manner?. Here is the card component

import React from "react";
import CalendarHeatmap from "reactjs-calendar-heatmap";

let chekc = [
  {
    date: "2016-01-01",
    total: 17164,
    details: [
      {
        name: "Project 1",
        date: "2016-01-01 12:30:45",
        value: 9192,
      },
      {
        name: "Project 2",
        date: "2016-01-01 13:37:00",
        value: 6753,
      },
      {
        name: "Project N",
        date: "2016-01-01 17:52:41",
        value: 1219,
      },
    ],
  },
];

function CheckCard({ name, runs, period, type, regions, data }) {
  return (
    <div className="raven-card raven-check">
      <div className="row">
        <div className="col-1 col-md-1"></div>
        <div className="col-5 col-md-5">
          <h4>{name}</h4>
        </div>
        <div className="col-1 col-md-1"></div>
        <div className="col-5  col-md-5"></div>
      </div>
      <div className="row">
        <div className="col-1 col-md-1"></div>
        <div className="col-5 col-md-5">
          <h6>{period}</h6>
        </div>
        <div className="col-1 col-md-1"></div>
        <div className="col-5  col-md-5"></div>
      </div>
      <hr />
      <div className="row">
        <div className="col-1  col-md-1"></div>
        <div className="col-10  col-md-10">
          <CalendarHeatmap data={chekc} overview="day"></CalendarHeatmap>
        </div>
        <div className="col-1  col-md-1"></div>
      </div>
    </div>
  );
}

export default CheckCard;
@g1eb
Copy link
Owner

g1eb commented Aug 22, 2020

Your example looks good as far as I can tell. I think it would appear to be stacked because that's how the 'day' overview is rendered, have you tried setting the overview='year' or overview='month'?

That's the equivalent of clicking on any particular month or day from the default 'year' overview, you can see it in action here: https://rawgit.com/g1eb/reactjs-calendar-heatmap/master/

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

2 participants