All Projects → shen-yu → hugo-chart

shen-yu / hugo-chart

Licence: Apache-2.0 license
a Chart.js component for Hugo. 📈

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to hugo-chart

twenty-twenty-hugo
Twenty Twenty Hugo is forked from WordPress Twenty Twenty theme. It's fully functional like the WordPress theme.
Stars: ✭ 48 (-32.39%)
Mutual labels:  hugo-theme, hugo
hucore
Minimal blog theme for hugo based on Hemingway2
Stars: ✭ 66 (-7.04%)
Mutual labels:  hugo-theme, hugo
showcase-hugo-theme
Showcase is a minimal, single page theme for Hugo
Stars: ✭ 54 (-23.94%)
Mutual labels:  hugo-theme, hugo
starter-hugo-research-group
👥 轻松创建研究组或组织网站 Easily create a stunning Research Group, Team, or Business Website with no-code
Stars: ✭ 148 (+108.45%)
Mutual labels:  hugo-theme, hugo
internet-weblog
internet weblog theme for Hugo
Stars: ✭ 33 (-53.52%)
Mutual labels:  hugo-theme, hugo
hugo-lime
Hugo Lime is a business theme for GoHugo by https://uicard.io
Stars: ✭ 31 (-56.34%)
Mutual labels:  hugo-theme, hugo
hugo-theme-minima
A clean and minimal Hugo theme.
Stars: ✭ 70 (-1.41%)
Mutual labels:  hugo-theme, hugo
hugo-documentation-theme
📖 Project Docs / Knowledge Base template for Hugo Website Builder. 创建项目文档
Stars: ✭ 101 (+42.25%)
Mutual labels:  hugo-theme, hugo
hugo-zen
Hugo Zen is a minimal hugo theme.
Stars: ✭ 90 (+26.76%)
Mutual labels:  hugo-theme, hugo
bulma
Bulma is a simple and a responsive Hugo theme that offers a traditional blog mixed with a landing page designed to bootstrap your frontend!.
Stars: ✭ 41 (-42.25%)
Mutual labels:  hugo-theme, hugo
hugo-uilite
uicard.io/products/hugo-uilite
Stars: ✭ 85 (+19.72%)
Mutual labels:  hugo-theme, hugo
whiteplain
Simple and Functional Hugo theme.
Stars: ✭ 95 (+33.8%)
Mutual labels:  hugo-theme, hugo
npqhugo
npq-hugo is a customizable and responsive dark blog theme with integrated contact form and code syntax highlighting
Stars: ✭ 24 (-66.2%)
Mutual labels:  hugo-theme, hugo
mogege
A blog theme for hugo
Stars: ✭ 81 (+14.08%)
Mutual labels:  hugo-theme, hugo
hugo-alabaster-theme
A documentation theme ported from Sphinx to Hugo
Stars: ✭ 73 (+2.82%)
Mutual labels:  hugo-theme, hugo
wowchemy-hugo-themes
🔥 Hugo website builder, Hugo themes & Hugo CMS. No code, easily build with blocks! 创建在线课程,学术简历或初创网站。#OpenScience
Stars: ✭ 6,891 (+9605.63%)
Mutual labels:  hugo-theme, hugo
axiom
Axiom - A Hugo Theme. GitTip: https://gitcoin.co/tip?username=jhauraw
Stars: ✭ 67 (-5.63%)
Mutual labels:  hugo-theme, hugo
hugo-lamp
A light Hugo AMP responsive theme for blogger ⚡.
Stars: ✭ 51 (-28.17%)
Mutual labels:  hugo-theme, hugo
hugo-theme-fluency
A fluent hugo theme.
Stars: ✭ 48 (-32.39%)
Mutual labels:  hugo-theme, hugo
uBlogger
A template designed with your readers in mind ❤️
Stars: ✭ 242 (+240.85%)
Mutual labels:  hugo-theme, hugo

hugo-chart

Awesome

English | 中文说明

About

This is not a standalone theme. It is a Hugo theme component providing a shortcode: chart to display Chart.js in your Hugo site.

Screenshot

Usage

  1. Add the hugo-chart as a submodule to be able to get upstream changes later git submodule add https://github.com/Shen-Yu/hugo-chart.git themes/hugo-chart

  2. Add hugo-chart as the left-most element of the theme list variable in your site's or theme's configuration file config.yaml or config.toml. Example, with config.yaml:

    theme: ["hugo-chart", "my-theme"]

    or, with config.toml,

    theme = ["hugo-chart", "my-theme"]
  3. In your site, use the shortcode, this way:

    {{< chart [width] [height] >}}
    // Chartjs options goes here
    {{< /chart >}}
    Name Type Default Description
    width number 100 The width of chart, responsive in window (%).
    height number 300 The height of chart (px).
  4. Note that Chartjs is responsive as default, in order for the above code to correctly resize the chart height, the maintainAspectRatio option must be set to false.

Example

{{< chart 90 200 >}}
{
    type: 'bar',
    data: {
        labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
        datasets: [{
            label: 'Bar Chart',
            data: [12, 19, 18, 16, 13, 14],
            backgroundColor: [
                'rgba(255, 99, 132, 0.2)',
                'rgba(54, 162, 235, 0.2)',
                'rgba(255, 206, 86, 0.2)',
                'rgba(75, 192, 192, 0.2)',
                'rgba(153, 102, 255, 0.2)',
                'rgba(255, 159, 64, 0.2)'
            ],
            borderColor: [
                'rgba(255, 99, 132, 1)',
                'rgba(54, 162, 235, 1)',
                'rgba(255, 206, 86, 1)',
                'rgba(75, 192, 192, 1)',
                'rgba(153, 102, 255, 1)',
                'rgba(255, 159, 64, 1)'
            ],
            borderWidth: 1
        }]
    },
    options: {
        maintainAspectRatio: false,
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero: true
                }
            }]
        }
    }
}
{{< /chart >}}

Bar chart

License

hugo-chart by Eric Shen is under GPL v3 license.

visitors-count

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].