Graphics with upper limit and lower limit.

27 views
Skip to first unread message

Luis Fernando Martins

unread,
Mar 24, 2017, 9:45:38 AM3/24/17
to Google Visualization API
How can I place reference lines in the chart?
 have to put 3 normal lines, upper limit and lower limit.

EXP:



I did this graphic but still did not find it as per the lines

<html><head><title>Charts of Quality</title><meta name="robots" content="noindex"></head><body>

<div id="continuous_date_chart">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  <script type="text/javascript">
    google.charts.load('current', {packages:['corechart']});
    google.charts.setOnLoadCallback(drawContinuousDateChart);
  function drawContinuousDateChart() {
    var data = new google.visualization.DataTable();
    data.addColumn('date', 'Date');
    data.addColumn('number', 'Mass (gm)');
data.addColumn({type: 'boolean', role: 'certainty'});
    data.addRows([
 [new Date(2017, 0, 1), 7, true],
      [new Date(2017, 0, 15), 10, true],
      [new Date(2017, 1, 1), 12, true],
      [new Date(2017, 1, 15), 30, true],
      [new Date(2017, 2, 1), 22, true],
      [new Date(2017, 2, 15), 25, true],
      [new Date(2017, 3, 1), 22, true],
      [new Date(2017, 3, 15), 30, true],
      [new Date(2017, 4, 1), 32, false]
 ]);

    var options = {
crosshair: { trigger: 'selection' },
      title: 'Graphics with upper limit and lower limit',
      width: 700, height: 400,
      legend: 'none',
 curveType: 'function',
 pointShape: 'circle',
      pointSize: 10,
 trendlines: { 0: {
 title: 'Linha de tendencia',
 type: 'linear', // linear, exponential ou polynomial
 degree: 30,
 tooltip: {isHtml: true},
          legend: 'none',
 tooltip: false ,
 color: ['red'],
 pointShape: 'circle',
 pointSize: 0,
 lineWidth: 1,}
 },
      hAxis: {title: 'Data', format: 'MMM yy'},
      vAxis: {title: 'Massa (gm)',gridlines: {count: 10,},}
     };

    var chart= new google.visualization.LineChart(document.getElementById('continuous_date_chart'));
    chart.draw(data, options);
  }
</script></div></body></html>


Reply all
Reply to author
Forward
0 new messages