minvalue

31 views
Skip to first unread message

corinne zaoui

unread,
Apr 5, 2013, 4:21:07 AM4/5/13
to google-visua...@googlegroups.com
Hi,

I try to fix minValue at 0 like this

    var view = new google.visualization.DataView(data);
        view.setRows(view.getFilteredRows([{column: 0, minValue:0},{column: 1, minValue:0},{column: 2, minValue:0}]));
 var options = {
       legend : {position: 'top', textStyle: {fontName: 'Arial', fontSize: '12', color: '666666'}},
          hAxis: { gridlines: { count:'0'}},
          vAxes:{
               0: {minValue : 0, textStyle: {fontName: 'Arial', fontSize: '12', color:'006699' },}, // Left axis
            1: {minValue : 0, textStyle: {fontName: 'Arial', fontSize: '12', color:'FF9900' },} // Right axis

But I have always negative values?
What it's wrong?
Thanks

asgallant

unread,
Apr 5, 2013, 10:04:33 AM4/5/13
to google-visua...@googlegroups.com
I need to see a working example in order to figure out what the problem is; can you provide your full code or a link to the page?

corinne zaoui

unread,
Apr 5, 2013, 10:53:48 AM4/5/13
to google-visua...@googlegroups.com

corinne zaoui

unread,
Apr 5, 2013, 10:53:56 AM4/5/13
to google-visua...@googlegroups.com
Thanks for your help
This is my full code



    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
     function drawChart() {

 



var data = google.visualization.arrayToDataTable([
['Années', 'Revenus', 'Charges','Disponibilités'],
[1, 138, 126.35,30],
                           [2, 138, 126.525,42],
                           [3, 138, 126.525,53],
                           [4, 138, 126.525,65],
                           [5, 138, 126.525,77],
                           [6, 135, 126.525,89],
                           [7, 135, 125.7875,99],
                           [8, 135, 125.7875,110],
                           [9, 135, 122.6071226191,121],
                           [10, 135, 122.6071226191,135],
                           [11, 135, 119.9930517759,149],
                           [12, 135, 119.48957766385,167],
                           [13, 134, 119.48957766385,186],
                           [14, 134, 119.73436649577,204],
                           [15, 134, 119.73436649577,222],
                           [16, 134, 119.73436649577,240],
                           [17, 134, 119.73436649577,259],
                           [18, 134, 119.73436649577,278],
                           [19, 134, 119.73436649577,297],
                           [20, 57, 99.394543791129,317],
                           [21, 56, 98.394543791129,281],
                           [22, 56, 98.394543791129,247],
                           [23, 56, 87.394543791129,212],
                           [24, 51, 85.394543791129,187],
                           [25, 51, 85.394543791129,158],
                           [26, 51, 85.394543791129,129],
                           [27, 52, 85.394543791129,99],
                           [28, 52, 85.394543791129,69],
                           [29, 51, 85.394543791129,39],
                           [30, 51, 85.394543791129,7],
                           [31, 51, 85.394543791129,-25],
                           [32, 51, 85.394543791129,-58],
                           [33, 51, 85.394543791129,-92],
                           [34, 51, 85.394543791129,-127],
                ]);


        var view = new google.visualization.DataView(data);
        view.setRows(view.getFilteredRows([{column: 0, minValue:0},{column: 1, minValue:0},{column: 2, minValue:0}]));
 var options = {
       legend : {position: 'top', textStyle: {fontName: 'Arial', fontSize: '12', color: '666666'}},
          hAxis: { gridlines: { count:'0'}},
          vAxes:{
               0: {minValue : 0, textStyle: {fontName: 'Arial', fontSize: '12', color:'006699' },}, // Left axis
            1: {minValue : 0, textStyle: {fontName: 'Arial', fontSize: '12', color:'FF9900' },} // Right axis
          },

    series: {
    0: {
        targetAxisIndex: 0,
        type: 'line'
    },
    1: {
        targetAxisIndex:0,
        type: 'line'
    },
    2: {
        targetAxisIndex: 1,
        type: 'area'
        }},
          colors: ['006699','33CCFF','FF9900'],
          areaOpacity:0.1
        };



         var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
        chart.draw(view, options);



}

    </script>
</div>
</div>
  <div id="chart_div" style=" margin-left:160px;float:left;width: 900px; height: 300px;"></div>

Corinne

asgallant

unread,
Apr 5, 2013, 12:39:18 PM4/5/13
to google-visua...@googlegroups.com
I think you want to filter on columns 1, 2, and 3 (not 0, 1, 2).  Be aware that when filtering like this, you lose all data points for any x-axis value where any data point is negative.

corinne zaoui

unread,
Apr 6, 2013, 12:19:38 PM4/6/13
to google-visua...@googlegroups.com
THANKS A LOT
It's exactly that I want


2013/4/5 asgallant <drew_g...@abtassoc.com>
--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/NIpxabXb59Q/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Cordialement,

Corinne Zaoui
Reply all
Reply to author
Forward
0 new messages