मुझे चार्ट ग्राफ का उपयोग करके बनाए गए बार ग्राफ पर दिखाने के लिए एक किंवदंती प्राप्त करने में समस्याएं आ रही हैं। प्रलेखन एक किंवदंती टेम्पलेट के बारे में बात करता है, लेकिन मुझे ग्राफ में इसे कार्यान्वित करने का एक अच्छा उदाहरण नहीं मिल रहा है। नीचे वह कोड है जिसका उपयोग मैं ग्राफ उत्पन्न करने के लिए कर रहा हूं।चार्टज बार चार्ट लीजेंड
<div style="width: 100%;">
<canvas id="canvas" height="450" width="600"></canvas>
<div id="legendDiv"> </div>
</div>
<script>
var randomScalingFactor = function(){ return Math.round(Math.random()*100)};
var barChartData = {
labels : ["Item 1","Item 2","Item 3","Item 4","Item 5","Item 6","Item 7","Item 8","Item 9","Item 10","Item 11","Item 12","Item 13","Item 14","Item 15","Item 16","Item 17"]
datasets : [
{
fillColor : "rgba(166,166,166,0.5)",
strokeColor : "rgba(166,166,166,0.8)",
highlightFill: "rgba(166,166,166,0.75)",
highlightStroke: "rgba(166,166,166,1)",
data : [10,4,3,4,3,6,4,1,10,3,3,10,2,4,10,3,4]
},
{
fillColor : "rgba(196,64,54,0.5)",
strokeColor : "rgba(196,64,54,0.8)",
highlightFill : "rgba(196,64,54,0.75)",
highlightStroke : "rgba(196,64,54,1)",
data : [6,3,2,3,2,3,4,1,8,3,3,6,1,3,8,3,4]
}
]
}
window.onload = function(){
var ctx = document.getElementById("canvas").getContext("2d");
window.myBar = new Chart(ctx).Bar(barChartData, {
responsive : true
});
}
</script>
<div>
नीचे दिए गए सहायता किया:
फिर किंवदंतियों जेनरेट करती हैं? – Quince