GithubHelp home page GithubHelp logo

chartjs-subtitle's People

Contributors

jeredmasters avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

taka-github1

chartjs-subtitle's Issues

No Legend

If there is no legend, the sub title just about sits on top of the graph as a pie, or bar. Those are the only ones I have tested. It would be nice to have some space between the graph and the subtitle when there is no legend.
Capture

Not generating subtitle

I've added the code in the readme to the plugins section, changed the display value to true and added my string to the text variable. However, a subtitle isn't generated. I don't get any errors in the console so I don't understand what is going on. Do I have to register it globally?

If I add Chart.plugins.register(chartJsPluginSubtitle) I get an error in the console: Uncaught ReferenceError: chartJsPluginSubtitle is not defined.

How to import it inside Webpack?

Hi, I've installed this plugin with npm, but I'm not able to import it with Webpack.
What have I'm supposed to write? I've written the following combinations without success:

import 'customjs-subtitle';
import SubtitlePlugin from 'customjs-subtitle';
import 'customjs-subtitle/build/Plugin.Subtitle.js';
import SubtitlePlugin from 'customjs-subtitle/build/Plugin.Subtitle.js';
import 'customjs-subtitle/src/plugin.js';
import SubtitlePlugin from 'customjs-subtitle/src/plugin.js';

My file, where chart.js works, is the following

import Chart from 'chart.js/dist/Chart';
import 'chartjs-subtitle'; // or another import from the list above...

export default class MyChart {
  constructor(data) {
    this.context = document.getElementById(canvasId).getContext('2d');
  }

  createChart() {
    new Chart(this.context, {
      type: 'bar',
      data: this.data,
      options: {
        title: {
          display: true,
          text: 'Chart Title,
        },
        plugins: {
          chartJsPluginSubtitle: {
            display: true,
            text: 'Subtitle',
          },
        },
      },
    });
  } // createChart()
} //MyChart()

What I'm missing?
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.