We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Is there a simple way to avoid Y to be double instead of int when no data/small amount of data

I have to show a number of downloads for some time period. I see that X is double when no data or just a few. Can it be integer?

1 Reply

SM Srihari Muthukaruppan Syncfusion Team November 8, 2019 12:25 PM UTC

Hi Dan, 

Greetings from syncfusion. 

We have analyzed your query. From that, we would like to let you know that, we can achieve your requirement using “labelFormat” and “Interval” property in primaryXAxis of chart. Based on that we have prepared a sample for your reference. Please find the below sample and code snippet. 

Code Snippet: 
        <ChartPrimaryXAxis LabelFormat="n0" Minimum="15" Maximum="19" Interval="1"></ChartPrimaryXAxis> 
            <ChartSeries DataSource="@chartData" XName="xValue" YName="yValue1" Opacity="1" Name="Germany" Fill="#1e90ff" Width=2 Type="ChartSeriesType.Column"> 
    public class DoubleData 
        public double xValue { get; set; } 
        public double yValue1 { get; set; } 
        public double yValue2 { get; set; } 
    public List<DoubleData> chartData = new List<DoubleData> 
                new DoubleData { xValue = 16, yValue1 = 2, yValue2= 7}, 
                new DoubleData { xValue = 17, yValue1 = 7, yValue2 = 8 }, 
                new DoubleData { xValue = 18, yValue1 = 10, yValue2 = 24 }, 

Note : Chart supports numeric value with double only. 
Let us know if you have any concerns. 

Srihari M 

Live Chat Icon For mobile
Up arrow icon