简体   繁体   中英

How do you add a heading to the chart generated by github-calendar?

I am using github-calendar to show my Github contributions on my website. I would like to add a title to the chart like it is shown in this comment . In my case, I just want bold text saying 'Contributions in the past 365 days.'

Screenshot of what I want

I have tried adding text inside the div, but it appears to be overwritten because I don't see it in the DOM.

<!-- Prepare a container for your calendar. -->
<div class="calendar">
<p>Contributions in the past 365 Days</p>
</div>
<script>

  GitHubCalendar(
    ".calendar",
    "jsolly", {
    global_stats: false,
    responsive: true,

  });

You might need to fork Bloggify/github-calendar and modify lib/index.js yourself.

For instance, using a insertBefore method to insert an <h2></h2> title before the svg.js-calendar-graph-svg section.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM