JavaScript Draw a line on Google Charts ScatterChart draw line google maps,draw line google docs,draw line

I have a ScatterChart where I need to draw a diagonal line (of the function y=x) that serves as a visual aid. Is it possible ? if so, how can I do it?

Answer:1

you can use a ComboChart to display both scatter and line series'

and a DataView to provide the function for y=x

see following working snippet...

google.charts.load('current', {
  callback: drawChart,
  packages:['corechart']
});

function drawChart() {
  var data = new google.visualization.DataTable();
  data.addColumn('number', 'x');
  data.addColumn('number', 'y0');
  data.addRows([
    [1,  37.8],
    [2,  30.9],
    [3,  25.4],
    [4,  11.7],
    [5,  11.9],
    [6,   8.8],
    [7,   7.6],
    [8,  12.3],
    [9,  16.9],
    [10, 12.8],
    [11,  5.3],
    [12,  6.6],
    [13,  4.8],
    [14,  4.2]
  ]);

  var view = new google.visualization.DataView(data);
  view.setColumns([0, 1, {
    label: 'y1=x',
    type: 'number',
    calc: function (dt, row) {
      return dt.getValue(row, 0)
    }
  }]);

  var options = {
    seriesType: 'scatter',
    series: {
      1: {
        type: 'line'
      }
    }
  };

  var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
  chart.draw(view, options);
}
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>
Answer:2

I'm really confused about importing a VueJs component. I'm using Vuejs 2.2.4, and I need to import a Vuejs component. Here is my app.js: Vue.component('Test', require('./Test.vue')); const app = ...

I'm really confused about importing a VueJs component. I'm using Vuejs 2.2.4, and I need to import a Vuejs component. Here is my app.js: Vue.component('Test', require('./Test.vue')); const app = ...

  1. dynamic import component vuejs
  2. import multiple components vuejs
  3. import css in component vuejs
  4. vuejs import component global
  5. vuejs import component without webpack
  6. vuejs import component webpack
  7. import component in another component vuejs
  8. vuejs import component unexpected identifier

I have an angular dropdown problem. I want to show projects with ng-repeat with dropdown selected value and split them into range. can anybody help me please? jsfiddle : http://jsfiddle.net/...

I have an angular dropdown problem. I want to show projects with ng-repeat with dropdown selected value and split them into range. can anybody help me please? jsfiddle : http://jsfiddle.net/...

  1. angularjs search filter multiple parameters
  2. angularjs search filter example
  3. angularjs search filter dropdown
  4. angularjs search filter select options
  5. angularjs search filter on specific field
  6. angularjs search filter table
  7. angularjs search filter with pagination
  8. angularjs search filter example jsfiddle
  9. angularjs search filter
  10. angularjs search filter table example
  11. angularjs search filter in controller
  12. angularjs search filter w3schools
  13. angularjs search filter not working
  14. angularjs search filter by property
  15. angularjs search filter date
  16. angularjs search filter function
  17. angularjs search filter array
  18. angularjs search filter ng repeat
  19. angularjs search filter is slow
  20. angularjs search filter count

Suppose I have a list of 3 items in an unordered list as follows <ul class = "list"> <li>1</li> <li>2</li> <li>3</li> </ul> Using .remove() I can ...

Suppose I have a list of 3 items in an unordered list as follows <ul class = "list"> <li>1</li> <li>2</li> <li>3</li> </ul> Using .remove() I can ...

In our application we are facing one issue. In my local eclipse whole application is working fine. But in Prod server we are facing this issue-When I want to load one page it is throwing error. The ...

In our application we are facing one issue. In my local eclipse whole application is working fine. But in Prod server we are facing this issue-When I want to load one page it is throwing error. The ...

  1. xmlhttprequest network error 0x2efd
  2. xmlhttprequest network error 0x2eff
  3. xmlhttprequest network error 0x2ef1
  4. xmlhttprequest network error access is denied
  5. xmlhttprequest network error 0x2efe
  6. xmlhttprequest network error 0x2ee2
  7. xmlhttprequest network error 0x800c0019
  8. xmlhttprequest network error 0x2ee7
  9. xmlhttprequest network error 0x2f78
  10. xmlhttprequest network error 00002eff
  11. xmlhttprequest network error 0x2ee4
  12. xmlhttprequest network error 0x2f7d
  13. xmlhttprequest network error 0x2efd ie11