Search code examples
charts

google chart: vAxis max value


I want to set a maximum value for the Y-axis (vertical). Unfortunately, it increases immediately when a larger value comes. What am I doing wrong?

(in Tasmota)

; 4h power chart - new value every 30s
$<div id="chart1" style="text-align:center;width:400px"></div>
$gc(lt s4h "wr" "Leistung [W]" cstr2)
$var options = {
$chartArea:{left:60,width:'83%%'},
$legend:'none',
**$vAxis:{format:'# W',minValue:0,maxValue:300},**
$explorer:{actions:['dragToZoom', 'rightClickToReset']},
$series: {0: {type: 'area'}},              
$title:'Verbrauch 4 Stunden [Watt]'
$};
$gc(e)

maxValue 300 I google an ask stuff. Nobody knows the answer.


Solution

  • Could you try setting viewWindow.max

    $vAxis:{format:'# W',minValue:0,maxValue:300, viewWindow: {max: 300, min: 0}},