score:1
Accepted answer
you have typo in your code:
<script scr="chart.min.js"></script>
should be:
<script src="chart.min.js"></script>
try to change your code like this:
<html>
<head>
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-ccuebr6csya4/9szppfrx3s49m9vuu5bgtijj06wt/s=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/1.0.2/chart.min.js">
</script>
</head>
<body>
`
<canvas id="canvas" width="400" height="400"></canvas>
<script>
var data = {
labels: ["january", "february", "march", "april", "may", "june", "july"],
datasets: [{
fillcolor: "rgba(220,220,220,0.5)",
strokecolor: "rgba(220,220,220,1)",
data: [65, 59, 90, 81, 56, 55, 40]
}, {
fillcolor: "rgba(151,187,205,0.5)",
strokecolor: "rgba(151,187,205,1)",
data: [28, 48, 40, 19, 96, 27, 100]
}]
}
var ctx = $("#canvas")[0].getcontext("2d");
var testchart = new chart(ctx).bar(data);
new chart(ctx).bar(data);
</script>
</body>
</html>
Source: stackoverflow.com
Related Query
- Chart.js runs in JSFiddle but not local "Chart is not defined"
- code works fine on jsfiddle but one function is not working on website
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- ReferenceError: Chart is not defined - chartjs
- show label in tooltip but not in x axis for chartjs line chart
- vue-chart.js : Data available as computed properties, but not showing in chart
- Chart JS Error: Chart is not defined Firefox
- Uncaught ReferenceError: Chart is not defined
- VueJs and ChartJs - Chart is responsive in width, but not height?
- ChartJS on NodeJS: error Chart is not defined
- The colors of the bar chart in chart.js is not showing. I tried background color and fill color but none of it worked
- Uncaught ReferenceError: Chart is not defined at test.html:11
- Chart.js line chart looking as area chart with smooth lines but not sharp
- Trying to create a custom tooltip in a doughnut chart using chartsjs, but it is not working
- Error says Chart is not defined
- Uncaught ReferenceError: Chart is not defined - Chart.js in laravel 5
- I have a chart but it is not updating the chart with react chart-js-2
- Pie Chart using chart.js not showing up but bar charts are?
- Uncaught ReferenceError: Chart is not defined in Laravel mix
- Chart is not defined Node.js Chart.js
- Chart.js - Uncaught ReferenceError: chart is not defined
- Yii2 Chart is not defined
- Trying to call API and plot a line chart but it does not show
- Chart.JS not working in Xpages, chart not defined errror
- angular-chart.js - chart height not working on iOS but works fine on Android and Web
- ReferenceError: Chart is not defined with primeNg and angular 4
- Getting a Chart is not defined ReferenceError with in React + React-chartjs
- how to not repeat code while creating multiple charts in chart js
- why i have this error Utils is not defined when i want create a chart from chart.js
- Canvas is not defined for simple chart
More Query from same tag
- Chart js animating a line while changing x-axis labels
- Have text displayed instead of numerical values on y axis
- How to use ChartJS object in a click event handler?
- Does the chartjs supports localization?
- Adjust appearance of tooltip in lien chart rendered by Chart.js
- Custom tooltip on Chart.js is coming undefined
- Chartjs Bar chart shows undefined values
- Chartkick cumulative chart by date never descending
- chart.js mixed chart types
- chart js date range picker apply function
- ChartJS: Change the positions of the tooltips
- Chart.js multi line chart that has different labels
- Minimum value for x Axis doesn't work for horizontal bar chart | ChartJS
- Why does putting two data sets with a Time Cartesian axis in Chart.js cause two Y axis tick sets?
- Why isn't my Angular 4 ChartJS component rendering?
- Images in ChartJS CustomTooltips
- Chart.js javascript from db stopped working after adding axes
- Showing points data withou hover chartjs
- Chartjs: customise legend based on background color
- Node.js How to save data from pg database into variable
- How to Draw Gantt chart using chart js or other libraries
- Chart.js - Adding Legend in a JSP Page
- Chart js custom datalabel from array
- Get multiple boxes in background in ChartJs
- Chart.js yAxes Ticks stepSize not working (fiddle)
- Chart point hover error
- React-Redux and Chart.js props Do not rerender
- Chart.js doughnut-like radar chart (no anglelines in the center/empty center)
- Chart.js line chart set background color
- how can i remove the grid lines in chartJs