function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chandra2ravichandra2ravi 

Gauge Chart Scale is not showing Correctly with small numbers below 20

Gauge Chart Scale is not showing Correctly

I need like 1 2 3 4 .... (scale =1)

But it is showing like 0,2,3,5,6,8....

 

===== VF Page ===============

<apex:page  Controller="GaugeChartController">
<apex:chart name="MyChart" height="300" width="450" animate="true" data="{!data}">
<apex:axis type="Gauge" position="gauge" title="Points" minimum="0" maximum="{!total }"/>
<apex:gaugeSeries dataField="size" donut="50" colorSet="#78c953,#ddd"/>
</apex:chart>
<script>
MyChart.on('beforeconfig', function(config) {
config.axes[0].margin=-10;
});
</script>
</apex:page>

 

======= Controller ==============

public class GaugeChartController {
public integer total {get;set;}

public List<gaugeData> getData() {
total =15;
List<gaugeData> data = new List<gaugeData>();
data.add(new gaugeData(10 + ' Opptys', 5));
system.debug('test $$$$ '+data);
return data;
}

public class gaugeData {
public String name { get; set; }
public Integer size { get; set; }

public gaugeData(String name, Integer data) {
this.name = name;
this.size = data;
}
}
}

 

Please correct me any thing wrong here. 

http://screencast.com/t/iI11VSFyCj4

cwall_sfdccwall_sfdc

Does apex:axis.steps=1 work?

 

Or

 

MyChart.on('beforeconfig', function(config) {
config.axes[0].steps=1;
});