> [CLOSED] show only whole numbers instead of decimals in the “Y” axis in chart

Hello!  
  
You should Decimals attribute: http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.chart.axis.Numeric-cfg-decimals  
  
<ext:NumericAxis   
Fields="Data1"  
Minimum="0"   
Decimals="0" />

Hello!  
  
You should Decimals attribute: http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.chart.axis.Numeric-cfg-decimals  
  
<ext:NumericAxis   
Fields="Data1"  
Minimum="0"   
Decimals="0" />  
  
thanks, it worked but now numbers are repeated:  
  
6063

Please provide a test case.

Please provide a test case.  
  
Here is the code behind and data.png is a screenshot with data, thanks  
  
6065  
  
Dim store = chrtGraficaIndicesDePersonal.GetStore  
  
store.Model.Clear()  
store.Reader.Clear()  
Dim m = New Model  
m.Name = "Mod"  
m.Fields.Add(New ModelField("Cantidad"))  
m.Fields.Add(New ModelField("NombreMes"))  
Dim AxesX = New CategoryAxis()  
Dim AxesY = New NumericAxis()  
  
AxesY.Fields = {"Cantidad"}  
AxesY.Grid = True  
AxesY.Title = "Asegurados"  
AxesY.Minimum = 0  
AxesY.Decimals = 0  
AxesY.Position = Position.Left  
  
AxesX.Fields = {"NombreMes"}  
AxesX.Position = Position.Bottom  
AxesX.Title = "Periodos"  
  
Dim MySerie = New ColumnSeries  
MySerie.SeriesID = "IdSerie"  
MySerie.Axis = Position.Left  
MySerie.Highlight = True  
  
MySerie.XField = {"NombreMes"}  
MySerie.YField = {"Cantidad"}  
Dim tp As New Ext.Net.ChartTip.Config  
tp.TrackMouse = True  
tp.Width = 200  
tp.Height = 30  
tp.ItemID = "tip"  
MySerie.Tips = New Ext.Net.ChartTip(tp)  
MySerie.Tips.Renderer.Handler = "this.setTitle(storeItem.get('NombreMes') + ': ' + storeItem.get('Cantidad'));"  
chrtGraficaIndicesDePersonal.Series.Add(MySerie)  
chrtGraficaIndicesDePersonal.Legend = True  
chrtGraficaIndicesDePersonal.Axes.Add(AxesY)  
chrtGraficaIndicesDePersonal.Axes.Add(AxesX)  
Dim a = chrtGraficaIndicesDePersonal.GetSprite("Titulo")  
a.Text = "Indices de personal del " + iAnio.ToString() + " - " + strConcepto  
store.Model.Add(m)  
  
store.DataSource = ocData  
store.DataBind()  
chrtGraficaIndicesDePersonal.Render(True)

Don't forget to use CODE tag.  
  
Try to use the following renderer:  
  
<ext:NumericAxis   
Fields="Data1"  
Position="Bottom"  
Grid="true"  
Minimum="0">  
<Label>  
<Renderer Handler="  
if (value.toString().indexOf('.') === -1){  
return value;  
} else {  
return '';  
}" />  
</Label>  
</ext:NumericAxis>

Don't forget to use CODE tag.  
  
Try to use the following renderer:  
  
<ext:NumericAxis   
Fields="Data1"  
Position="Bottom"  
Grid="true"  
Minimum="0">  
<Label>  
<Renderer Handler="  
if (value.toString().indexOf('.') === -1){  
return value;  
} else {  
return '';  
}" />  
</Label>  
</ext:NumericAxis>   
  
I use it in the code behind,   
  
AxesY.Label.Renderer.Handler = "if (value.toString().indexOf('.') == -1){return value;} else { Return ''; }"  
  
but does not work, send me message null reference

I've tried the following code and it works fine:  
  
<%@ Page Language="C#" %>  
<%@ Import Namespace="Ext.Net.Examples" %>  
  
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>  
  
<script runat="server">  
  
protected void Page_Load(object sender, EventArgs e)  
{  
Chart1.Axes[0].Label.Renderer.Handler = @"  
if (value.toString().indexOf('.') === -1){  
return value;  
} else {  
return '';  
}";  
}  
public List<ChartData> Data  
{  
get  
{  
return new List<ChartData>  
{  
new ChartData() { Name = "1", Data1 = 1 },  
new ChartData() { Name = "2", Data1 = 2.4 },  
new ChartData() { Name = "3", Data1 = 3.6 },  
new ChartData() { Name = "4", Data1 = 5 },  
};  
}  
}  
  
</script>  
  
<!DOCTYPE html>  
  
<html>  
<head runat="server">  
<title>Ext.NET Examples</title>  
  
</head>  
<body>  
<form runat="server">  
<ext:ResourceManager runat="server" />  
  
<ext:Panel   
runat="server"  
Title="Bar Chart"  
Width="800"  
Height="600"  
Layout="FitLayout">  
<Items>  
<ext:Chart   
ID="Chart1"   
runat="server"  
Shadow="true"  
Animate="true">  
<Store>  
<ext:Store   
runat="server"   
Data="<%# Data %>"   
AutoDataBind="true">   
<Model>  
<ext:Model runat="server">  
<Fields>  
<ext:ModelField Name="Name" />  
<ext:ModelField Name="Data1" />  
</Fields>  
</ext:Model>  
</Model>  
</ext:Store>  
</Store>  
  
<Axes>  
<ext:NumericAxis   
Fields="Data1"  
Position="Bottom"  
Grid="true"  
Minimum="0">  
<Label>  
</Label>  
</ext:NumericAxis>  
  
<ext:CategoryAxis   
Fields="Name"  
Position="Left"  
Title="Month of the Year"  
/>   
</Axes>  
  
<Series>  
<ext:BarSeries   
Axis="Bottom"  
Highlight="true"   
XField="Name"   
YField="Data1">  
<Tips TrackMouse="true" Width="140" Height="28">  
<Renderer Handler="this.setTitle(storeItem.get('Name') + ': ' + storeItem.get('Data1') + ' views');" />  
</Tips>  
<Label   
Display="InsideEnd"   
Field="Data1"   
Orientation="Horizontal"   
Color="#333"   
TextAnchor="middle"  
/>  
</ext:BarSeries>  
</Series>  
</ext:Chart>  
</Items>  
</ext:Panel>  
</form>   
</body>  
</html>

I've tried the following code and it works fine:  
  
<%@ Page Language="C#" %>  
<%@ Import Namespace="Ext.Net.Examples" %>  
  
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>  
  
<script runat="server">  
  
protected void Page_Load(object sender, EventArgs e)  
{  
Chart1.Axes[0].Label.Renderer.Handler = @"  
if (value.toString().indexOf('.') === -1){  
return value;  
} else {  
return '';  
}";  
}  
public List<ChartData> Data  
{  
get  
{  
return new List<ChartData>  
{  
new ChartData() { Name = "1", Data1 = 1 },  
new ChartData() { Name = "2", Data1 = 2.4 },  
new ChartData() { Name = "3", Data1 = 3.6 },  
new ChartData() { Name = "4", Data1 = 5 },  
};  
}  
}  
  
</script>  
  
<!DOCTYPE html>  
  
<html>  
<head runat="server">  
<title>Ext.NET Examples</title>  
  
</head>  
<body>  
<form runat="server">  
<ext:ResourceManager runat="server" />  
  
<ext:Panel   
runat="server"  
Title="Bar Chart"  
Width="800"  
Height="600"  
Layout="FitLayout">  
<Items>  
<ext:Chart   
ID="Chart1"   
runat="server"  
Shadow="true"  
Animate="true">  
<Store>  
<ext:Store   
runat="server"   
Data="<%# Data %>"   
AutoDataBind="true">   
<Model>  
<ext:Model runat="server">  
<Fields>  
<ext:ModelField Name="Name" />  
<ext:ModelField Name="Data1" />  
</Fields>  
</ext:Model>  
</Model>  
</ext:Store>  
</Store>  
  
<Axes>  
<ext:NumericAxis   
Fields="Data1"  
Position="Bottom"  
Grid="true"  
Minimum="0">  
<Label>  
</Label>  
</ext:NumericAxis>  
  
<ext:CategoryAxis   
Fields="Name"  
Position="Left"  
Title="Month of the Year"  
/>   
</Axes>  
  
<Series>  
<ext:BarSeries   
Axis="Bottom"  
Highlight="true"   
XField="Name"   
YField="Data1">  
<Tips TrackMouse="true" Width="140" Height="28">  
<Renderer Handler="this.setTitle(storeItem.get('Name') + ': ' + storeItem.get('Data1') + ' views');" />  
</Tips>  
<Label   
Display="InsideEnd"   
Field="Data1"   
Orientation="Horizontal"   
Color="#333"   
TextAnchor="middle"  
/>  
</ext:BarSeries>  
</Series>  
</ext:Chart>  
</Items>  
</ext:Panel>  
</form>   
</body>  
</html>  
  
shows no information, I do so:  
  
Dim lbl As New Ext.Net.AxisLabel  
AxesY.Label = lbl  
  
chrtGraficaIndicesDePersonal.Axes.Add(AxesY)  
chrtGraficaIndicesDePersonal.Axes.Add(AxesX)  
chrtGraficaIndicesDePersonal.Axes(0).Label.Rendere r.Handler = "if (value.toString().indexOf('.') === -1){return value;} else {Return '';}"

You should initialize Label field before setting Renderer:  
  
<%@ Page Language="C#" %>  
<%@ Import Namespace="Ext.Net.Examples" %>  
  
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>  
  
<script runat="server">  
  
protected void Page_Load(object sender, EventArgs e)  
{  
Chart1.Axes.Add(new NumericAxis  
{  
Fields = new[] { "Data1" },  
Position = Position.Bottom,  
Grid = true,  
Minimum = 0,  
Label = new AxisLabel()  
});  
Chart1.Axes.Add(new CategoryAxis  
{  
Fields = new[] { "Name" },  
Position = Position.Left,  
Title = "Month of the Year"  
});  
Chart1.Axes[0].Label.Renderer.Handler = @"  
if (value.toString().indexOf('.') === -1){  
return value;  
} else {  
return '';  
}";  
}  
public List<ChartData> Data  
{  
get  
{  
return new List<ChartData>  
{  
new ChartData() { Name = "1", Data1 = 1 },  
new ChartData() { Name = "2", Data1 = 2.4 },  
new ChartData() { Name = "3", Data1 = 3.6 },  
new ChartData() { Name = "4", Data1 = 5 },  
};  
}  
}  
  
</script>  
  
<!DOCTYPE html>  
  
<html>  
<head runat="server">  
<title>Ext.NET Examples</title>  
  
</head>  
<body>  
<form runat="server">  
<ext:ResourceManager runat="server" />  
  
<ext:Panel  
runat="server"  
Title="Bar Chart"  
Width="800"  
Height="600"  
Layout="FitLayout">  
<Items>  
<ext:Chart  
ID="Chart1"  
runat="server"  
Shadow="true"  
Animate="true">  
<Store>  
<ext:Store  
runat="server"  
Data="<%# Data %>"   
AutoDataBind="true">   
<Model>  
<ext:Model runat="server">  
<Fields>  
<ext:ModelField Name="Name" />  
<ext:ModelField Name="Data1" />  
</Fields>  
</ext:Model>  
</Model>  
</ext:Store>  
</Store>  
  
<Axes>  
  
</Axes>  
  
<Series>  
<ext:BarSeries  
Axis="Bottom"  
Highlight="true"  
XField="Name"  
YField="Data1">  
<Tips TrackMouse="true" Width="140" Height="28">  
<Renderer Handler="this.setTitle(storeItem.get('Name') + ': ' + storeItem.get('Data1') + ' views');" />  
</Tips>  
<Label  
Display="InsideEnd"  
Field="Data1"  
Orientation="Horizontal"  
Color="#333"  
TextAnchor="middle"  
/>  
</ext:BarSeries>  
</Series>  
</ext:Chart>  
</Items>  
</ext:Panel>  
</form>   
</body>  
</html>

You should initialize Label field before setting Renderer:  
  
<%@ Page Language="C#" %>  
<%@ Import Namespace="Ext.Net.Examples" %>  
  
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>  
  
<script runat="server">  
  
protected void Page_Load(object sender, EventArgs e)  
{  
Chart1.Axes.Add(new NumericAxis  
{  
Fields = new[] { "Data1" },  
Position = Position.Bottom,  
Grid = true,  
Minimum = 0,  
Label = new AxisLabel()  
});  
Chart1.Axes.Add(new CategoryAxis  
{  
Fields = new[] { "Name" },  
Position = Position.Left,  
Title = "Month of the Year"  
});  
Chart1.Axes[0].Label.Renderer.Handler = @"  
if (value.toString().indexOf('.') === -1){  
return value;  
} else {  
return '';  
}";  
}  
public List<ChartData> Data  
  
get  
{  
return new List<ChartData>  
{  
new ChartData() { Name = "1", Data1 = 1 },  
new ChartData() { Name = "2", Data1 = 2.4 },  
new ChartData() { Name = "3", Data1 = 3.6 },  
new ChartData() { Name = "4", Data1 = 5 },  
};  
}  
}  
  
</script>  
  
<!DOCTYPE html>  
  
<html>  
<head runat="server">  
<title>Ext.NET Examples</title>  
  
</head>  
<body>  
<form runat="server">  
<ext:ResourceManager runat="server" />  
  
<ext:Panel  
runat="server"  
Title="Bar Chart"  
Width="800"  
Height="600"  
Layout="FitLayout">  
<Items>  
<ext:Chart  
ID="Chart1"  
runat="server"  
Shadow="true"  
Animate="true">  
<Store>  
<ext:Store  
runat="server"  
Data="<%# Data %>"   
AutoDataBind="true">   
<Model>  
<ext:Model runat="server">  
<Fields>  
<ext:ModelField Name="Name" />  
<ext:ModelField Name="Data1" />  
</Fields>  
</ext:Model>  
</Model>  
</ext:Store>  
</Store>  
  
<Axes>  
  
</Axes>  
  
<Series>  
<ext:BarSeries  
Axis="Bottom"  
Highlight="true"  
XField="Name"  
YField="Data1">  
<Tips TrackMouse="true" Width="140" Height="28">  
<Renderer Handler="this.setTitle(storeItem.get('Name') + ': ' + storeItem.get('Data1') + ' views');" />  
</Tips>  
<Label  
Display="InsideEnd"  
Field="Data1"  
Orientation="Horizontal"  
Color="#333"  
TextAnchor="middle"  
/>  
</ext:BarSeries>  
</Series>  
</ext:Chart>  
</Items>  
</ext:Panel>  
</form>   
</body>  
</html>  
}  
  
not working,  
  
this code:  
  
Dim store = chrtGraficaIndicesDePersonal.GetStore  
  
store.Model.Clear()  
store.Reader.Clear()  
Dim m = New Model  
m.Name = "Mod"  
m.Fields.Add(New ModelField("Cantidad"))  
m.Fields.Add(New ModelField("NombreMes"))  
Dim AxesX = New CategoryAxis()  
Dim AxesY = New NumericAxis()  
  
AxesY.Fields = {"Cantidad"}  
AxesY.Grid = True  
AxesY.Title = "Asegurados"  
AxesY.Minimum = 0  
AxesY.Label = New Ext.Net.AxisLabel()  
  
AxesY.Position = Position.Left  
  
AxesX.Fields = {"NombreMes"}  
AxesX.Position = Position.Bottom  
AxesX.Title = "Periodos"  
  
Dim MySerie = New ColumnSeries  
MySerie.SeriesID = "IdSerie"  
MySerie.Axis = Position.Left  
MySerie.Highlight = True  
  
MySerie.XField = {"NombreMes"}  
MySerie.YField = {"Cantidad"}  
Dim tp As New Ext.Net.ChartTip.Config  
tp.TrackMouse = True  
tp.Width = 200  
tp.Height = 30  
tp.ItemID = "tip"  
MySerie.Tips = New Ext.Net.ChartTip(tp)  
MySerie.Tips.Renderer.Handler = "this.setTitle(storeItem.get('NombreMes') + ': ' + storeItem.get('Cantidad'));"  
  
chrtGraficaIndicesDePersonal.Series.Add(MySerie)  
chrtGraficaIndicesDePersonal.Legend = True  
chrtGraficaIndicesDePersonal.Axes.Add(AxesY)  
chrtGraficaIndicesDePersonal.Axes.Add(AxesX)  
chrtGraficaIndicesDePersonal.Axes(0).Label.Rendere r.Handler = "if (value.toString().indexOf('.') === -1){return value;} else {Return '';}"  
  
Dim a = chrtGraficaIndicesDePersonal.GetSprite("Titulo")  
a.Text = "Indices de personal del " + iAnio.ToString() + " - " + strConcepto  
  
store.Model.Add(m)  
store.DataSource = ocData  
store.DataBind()  
chrtGraficaIndicesDePersonal.Render(True)  
  
thanks!

What error do you receive? Can you provide full test case to reproduce?