score:0
Worked for me : yeah as Yannis pointed out it has to be new Chart (instantiating the Chart object) see here and scroll down :
var radarChartData = {
labels: ["x", "x", "x", "x", "x"],
datasets: [{
fillColor: "rgba(255, 97, 10, 0.5)",
strokeColor: "rgb(255, 97, 10)",
pointColor: "rgba(255, 255, 255, 1)",
pointStrokeColor: "rgba(255, 255, 255, 1)",
data: [48, 46, 47, 48, 38]
}]
}
var inView = false;
function isScrolledIntoView(elem)
{
var docViewTop = $(window).scrollTop();
var docViewBottom = docViewTop + $(window).height();
var elemTop = $(elem).offset().top;
var elemBottom = elemTop + $(elem).height();
return ((elemTop <= docViewBottom) && (elemBottom >= docViewTop));
}
$(window).scroll(function () {
if (isScrolledIntoView('#canvas')) {
if (inView) {
return;
}
inView = true;
new
Chart(document.getElementById("canvas").getContext("2d")).Radar(radarChartData, {
scaleShowLabels: false,
scaleShowLabelBackdrop: false,
scaleFontColor: "#fff",
pointLabelFontSize: 14,
pointLabelFontColor: "#fff",
angleLineColor: "rgba(163, 165, 93,0.8)",
scaleLineColor: "rgba(163, 165, 93,0.5)"
});
} else {
inView = false;
}
});
score:1
You need to move your scripts
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="js/Chart.js"></script>
to the top before the </head>
to avoid any possible script clash and as I said in my comment, you have a typo:
newChart
instead of the correct one new Chart
Source: stackoverflow.com
Related Query
- ChartJS and Radar Chart animation
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- chartjs datalabels change font and color of text displaying inside pie chart
- chartjs - top and bottom padding of a chart area
- Category scale on Y-axis and time on x-axis in bubble chart in Chartjs
- ChartJS Radar Chart radar lines color?
- Chartjs not rendering chart and no error thrown
- ChartJS Line chart cut off at the top and bottom
- ChartJS V3 Radar chart Label Font Size
- ChartJS line chart drag and zoom
- Chartjs 3.5.0 - Radar Chart - Converting the labels to images
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- Create Chart using Reactjs Chartjs and axios
- Why would a ChartJS chart end up with width 0 and height 0?
- ChartJS - radar chart options not working
- Meteor and ChartJS dynamically create a chart
- Grouped Bar Chart from mySQL database using ChartJS and PHP
- ChartJS replay chart animation when called by show()
- Chartjs - Set start and end value into a Bar Chart
- Chartjs - Add backgroundColor for labels radar chart
- Chart load time and animation slow on mobile device
- ChartJS automatically scaled chart has undefined min and max
- How to update a chart using VueJS and ChartJS
- create Chart using Chartjs and PHP
- Bar chart with min height and zero values - ChartJs
- How to reuse a Chartjs Chart component in with different Data and get past the **Canvas is already in use** error?
- how to increase space between legend and chart in chartjs (ng2charts ) using angular
- VueJs and ChartJs - Chart is responsive in width, but not height?
- Chartjs Doughnut Chart smooth animation in countdown
- ChartJS : Hook before values are given to doughnut (absolute value in chart and real values in the tooltips)
More Query from same tag
- Chart.js and right side free space
- Why prettier put a comma ',' at the last element of the object
- Creating multiple charts and selecting them later
- Chart.js annotations in Vue.js break when defined in data ()
- Displaying a chart using Chart.js
- null values for instead of date causes the browser to crash while using chart js
- chart.js coffeescript can't find variable
- Can't create separate charts using chart.js
- Problem for display a chart with Chart.js and Angular
- How to properly use the chartjs datalabels plugin
- Chart.JS canvas gets larger every time drawn
- XMLHTTPRequest Repeating Entries on ChartJS
- Different major tick format in Chart.js
- React-Chartjs-2 and Chartjs v3:Option Property
- Set fixed label size for grouped bar chart in angular Chartjs
- Update data when pressing submit in chartjs in vuejs
- How to display datasets correctly on a graph using Chart.js
- I cannot update my chart ( in react-chartjs-2 )
- chart.js Failed to create chart: can't acquire context from the given item
- is it possible to get time in box charts in chartjs?
- Array of objects condensed into array of unique objects with nested array
- Chartjs hide dataset legend v3
- Weird time formating with chart.js and moment.js
- chart js download to png with canvas.toDataURL() not working in IE and firefox
- How to assign specific colors to data items in a doughnut chart in Angular Chart?
- Vue.js access variable from method
- Chart.js and PHP
- Chart.js: Reverse bar chart with regular bars (Bottom to top instead of top to bottom)
- Chart.js ignoring fill to start
- "Maximum call stack size" Error When Adding Data to Chartjs Using Props With Fetch (Vue/Chartjs)