Forum

Shaila
Participant
    6 years, 8 months ago #14492
    Up
    0
    Down
    ::

    Hello Chris,
    I am trying to generate a line chart for the following data

    [90,0,20,0,85,30,40]

    I was successful in getting the charts but the graph plotted was for just first two values please check the image attached

    So to further investigate I put the console.log in widget Chart.js just before it generates the Chart as below

    generateChart: function() {
                if (!this._chartInstance) {
                    
                    var data = {};
                    
                    if(this.generateLabels().length > 0) {
                        data.labels = this.generateLabels();
                    }
                    
                    data.datasets = this.generateDatasets();
                    console.log("Debug to check dataset format");
                    console.log(JSON.stringify(data));
                    console.log(data);
                    
                    this._chartInstance = new Chart(this.getId() + "--canvas", {
                        type: this.getChartType(),
                        data: data,
                        options: this._options
                    });
                    
                    this._options = this._chartInstance.options;
                }

    so when I run your application (SIMP_Template_Charts) and my application (LOCOPE) and check the console.log I don’t see any differences, please find the output from my application below

    {“datasets”:[{“backgroundColor”:”#00AF00″,”borderColor”:”#00AF00″,”data”:[90,0,20,0,85,30,40],”fill”:false,”lineTension”:0,”pointRadius”:1}]}

    Can you please check my application “LOCOPE” and help me out figure out the problem.

    Thanks in adavance

    Regards,
    Shaila

    Attachments:
    You must be logged in to view attached files.