JavaScript Chart.js wont display normal chart chart wont show,chart won't show up,excel

I have an issue with Chart.js. when I had my data inside Javascript, it showed the graph just fine. Now I would like to make it ready from JSON. but for some reason its reading wrong. I followed the example from their website and it suppose to show me this enter image description here but instead I get to see this enter image description here Notice the 3 first weeks have data on them. when I hover over them it shows me the data. here is the JSON

[{
"label": "Net Comp",
"color": "#F02626",
"data": [520, 600, 850, 900, 300]
},
{
"label": "AnalyzerHR",
"color": "#26F041",
"data": [ [6, 300], [7, 400], [8, 550], [9, 750], [10, 200] ]
},
{
"label": "Question Right",
"color": "#20AEFA",
"data": [ [6, 200], [7, 150], [8, 380], [9, 400], [10, 100] ]

}] so the 3 data are packed as array and they are display on the 3 first labels. So when I hover it shows to me 520, 600, 850, 900, 300 . And this is wrong because each value in data should be over 1 of the weeks. not the 1 data in the 1st week only. here is my Javascript

$(document).ready(function() {

$.getJSON('data.json', function(data){
    console.log(data);

    var myData = (data);

    Array.prototype.mapProperty = function(property) {
    return this.map(function (obj) {
      return obj[property];
     });
    };
    lineChartData = {
        labels : [["Week 47"],[7,"week 48"], [8,"Week 49"], [9,"Week 50"], [10,"Week 51"], [11,"Week 52"]],
        datasets: [
        {        
        label: "Test",
        fillColor : "rgba(220,220,220,0.2)",
        strokeColor : "rgba(220,220,220,1)",
        pointColor : "rgba(220,220,220,1)",
        pointStrokeColor : "#fff",
        pointHighlightFill : "#fff",
        pointHighlightStroke : "rgba(220,220,220,1)",
        data : myData.mapProperty("data"),

    }]};
    var ctx = document.getElementById("myLineChart").getContext("2d");
    var myLineChart = new Chart(ctx).Line(lineChartData);

});

});

How can I set each data value to a different week? I cant see any mistake in my code (I know there is somewhere). Chartjs is able to read JSON and display it, but in the wrong place

Thank you in advance

Edited I found where the problem is but I can't find the way to fix it. I made some testings and it seems that while in Javascript Chartjs is reading the data as [1,2,3,4,5,6,7]. But when I call it, it gets all 3 objects. and it wont accept when I write something like data : chartjsData.data inside the datasets

Answer:1

I am trying to detect the given word is default keyword or not in JavaScript? Example: I have an array like arr=["function","some"] these are default keywords. If i write word like as 'function' or '...

I am trying to detect the given word is default keyword or not in JavaScript? Example: I have an array like arr=["function","some"] these are default keywords. If i write word like as 'function' or '...

I'm wondering how to access a public property from private and public functions in a JavaScript module? For example, if this is my module: var PersonModule = (function(){ var sayHello = ...

I'm wondering how to access a public property from private and public functions in a JavaScript module? For example, if this is my module: var PersonModule = (function(){ var sayHello = ...

  1. access public property in aspx page
  2. access public property
  3. access public property in javascript
  4. access public property c#
  5. access public property in another class c#
  6. public access property search
  7. public access property detail
  8. php access public property
  9. typescript access public property
  10. ms access public property
  11. access vba public property
  12. public access private property
  13. right to access public property
  14. how to access public property records for free
  15. multnomah public access property detail
  16. how to access public property records
  17. philadelphia public access property records
  18. c# cannot access public property
  19. asp.net access public property in master page
  20. honolulu public access property

I have a maybe little problem. I use the swiper plugin and inside I have one select that is overrided by the jQuery UI select menu. <script type="text/javascript"> $(select).selectmenu() var ...

I have a maybe little problem. I use the swiper plugin and inside I have one select that is overrided by the jQuery UI select menu. <script type="text/javascript"> $(select).selectmenu() var ...

  1. jquery selectmenu set value
  2. jquery selectmenu on change
  3. jquery selectmenu refresh
  4. jquery selectmenu width
  5. jquery selectmenu select option
  6. jquery selectmenu get selected value
  7. jquery selectmenu multiple
  8. jquery selectmenu is not a function
  9. jquery selectmenu disable
  10. jquery selectmenu destroy
  11. goquery selection reset
  12. goquery selection size
  13. jquery selectmenu trigger change
  14. goquery selection change value
  15. jquery selectmenu widget
  16. jquery selectmenu change selected option
  17. goquery selection not working
  18. jquery select menu
  19. jquery select menu value
  20. jquery select menu item

I want to find the next element with a given class after the element which trigged the event, regardless of the position of the searched element. Let’s say I have multiple pairs of inputs. One with ...

I want to find the next element with a given class after the element which trigged the event, regardless of the position of the searched element. Let’s say I have multiple pairs of inputs. One with ...

  1. next element with class javascript
  2. next element with class jquery
  3. next element with class css
  4. next element with same class jquery
  5. next element with class
  6. next element with id jquery
  7. next element with css
  8. next element with javascript
  9. next element with jquery
  10. next element in list python
  11. next element in array javascript
  12. next element in array python
  13. next element in vector c++
  14. next element in list
  15. next element for loop python
  16. next element in xpath
  17. next element in array php
  18. next element in map c++
  19. next element in array java
  20. next element in foreach java