question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

0.4.0 Unable to Get Working

See original GitHub issue

Hi Team,

I am using vanilla .NET MVC website (have razor cshtml view file) where I have got both chart.js and chartjs-plugin-colorschemes installed (installed via LibMan client side library). Having followed instructions, I am receiving the following message on console (F12 dev tools in browser):

Uncaught TypeError: Cannot read properties of undefined (reading ‘plugins’) in both .min.js and .js versions.

Inspecting the main JS file the error is here:

Chart.defaults.global.plugins.colorschemes = {
	scheme: 'brewer.Paired12',
	fillAlpha: 0.5,
	reverse: false,
	override: false
};

Additionally, I tried the NPM runkit option: https://npm.runkit.com/chartjs-plugin-colorschemes and it returns the same error.

My Razor Page:

<div class="row">
        <div class="col-lg-4">
            <canvas id="myChart"></canvas>
        </div>
    </div>

<script>
    const ctx = document.getElementById('myChart').getContext('2d');
    const myChart = new Chart(ctx, {
        type: 'bar',
        data: {
            labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
            datasets: [{
                label: '# of Votes',
                data: [4, 6, 3, 5, 2, 3],               
                borderWidth: 1
            }]
        },
        options: {
            plugins: {
                colorschemes: {
                    scheme: 'brewer.GnBu6'
                }
            }
        }
    });
</script>

My Master / Layout page:

<script src="~/Content/js/ChartJS3.7.1/chart.min.js"></script>
<script src="~/Content/js/ChartJsColorSchemes0.4.0/chartjs-plugin-colorschemes.js"></script>

My Index View: The bar chart renders but without any colours scheme applied.

Perhaps I am not doing something right? Apologies if that is the case.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:9

github_iconTop GitHub Comments

1reaction
ivangomescommented, Nov 1, 2022

Is this repository active?

1reaction
jayantbhcommented, Sep 28, 2022

https://www.npmjs.com/package/hw-chartjs-plugin-colorschemes

This seems to be a fork published to work with chartjs v3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bump mini_racer from 0.4.0 to 0.5.0 getting compile errors #220
It looks like there's been a regression and that error is no longer raised. If that error still existed it would prevent this...
Read more >
Failed to resolve firebase-ui:0.4.0 - Stack Overflow
Just build your project with the gradle flag --refresh-dependencies to make sure it re-downloads deps and does not use the cached copy.
Read more >
Unable to find image 'bitbucketpipelines/ssh-run:0.4.0' locally
0' locally" is a completely fine error as the pipe is not stored locally so it won't be able to find it hence...
Read more >
Local or Remote Connections to Database and Using TCP ...
With a new installation of Oracle Database 11.2.0.4 local TCP connections fail when connecting through the Listener:.
Read more >
I can't install TensorFlow-macos a… | Apple Developer Forums
Can you recreate how you were able to get it to work after using a python 3.8 ... 4.0.0 flatbuffers 1.12 gast 0.4.0...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found