Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. Google Chart - All series on a given axis must be of the same data type - error

Google Chart - All series on a given axis must be of the same data type - error

Scheduled Pinned Locked Moved JavaScript
toolsjsonhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    miss786
    wrote on last edited by
    #1

    Dear all, I am experiencing the following error on the client-end -- All series on a given axis must be of the same data type. I have added in new control chartRangeSlider, which is causing this error, i think. I have checked the API documentation and I cannot seem to figure where I may be going wrong.

    function drawVisualization(dataValues, chartTitle, columnNames, categoryCaption) {
    if (dataValues.length < 1)
    return;
    var data = new google.visualization.DataTable();
    data.addColumn('string', columnNames.split(',')[0]);
    data.addColumn('number', columnNames.split(',')[1]);
    data.addColumn('string', columnNames.split(',')[2]);
    data.addColumn('datetime', columnNames.split(',')[3]);
    data.addColumn('number', columnNames.split(',')[4]);

        for (var i = 0; i < dataValues.length; i++) {
    	
            var date = new Date(parseInt(dataValues\[i\].Date.substr(6), 10));
            data.addRow(\[dataValues\[i\].ColumnName, dataValues\[i\].Value, dataValues\[i\].Type, date, dataValues\[i\].ID\]);
        }
    
        // Define a Pie chart
        var pie = new google.visualization.ChartWrapper({
            'chartType': 'LineChart',
            'containerId': 'PieChartContainer',
            'options': {
                'width': 950,
                'height': 450,
                'legend': 'right',
    
                //'hAxis': {
                 //'format': "dd-MMM-yyyy",
                // 'maxValue': new Date (2014, 03, 07), 'minValue': new Date (2014, 02, 20), 
               //  'viewWindow':{'max': new Date (2014, 03, 17)},
               // },
                 
                'title': chartTitle,
                'chartArea': { 'left': 100, 'top': 100, 'right': 0, 'bottom': 100 },
                'pieSliceText': 'label',
                'tooltip': {isHtml: true}
            },
            'view': { 'columns': \[4, 1\] }
        });
    
        // Create a date range slider  
        var myIdSlider = new google.visualization.ControlWrapper({  
        'controlType': 'ChartRangeFilter',  
        'containerId': 'control\_div',  
        'options': {  
            'filterColumnLabel': columnNames.split(',')\[4\],
            'filterColumnIndex': '4',
            'chartView': { 'columns': \[4, 1\] },
            }
          }); 
        new google.visualization.Dashboard(document.getElementById('PieChartExample')).bind(\[myIdSlider\], \[pie\]).draw(data);
    }
    

    </script>

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups