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

<EjsChart></EjsChart>
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: 
    <EjsChart> 
        <ChartPrimaryXAxis LabelFormat="n0" Minimum="15" Maximum="19" Interval="1"></ChartPrimaryXAxis> 
        <ChartSeriesCollection> 
            <ChartSeries DataSource="@chartData" XName="xValue" YName="yValue1" Opacity="1" Name="Germany" Fill="#1e90ff" Width=2 Type="ChartSeriesType.Column"> 
            </ChartSeries> 
        </ChartSeriesCollection> 
    </EjsChart> 
@code{ 
    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 }, 
             }; 
} 

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

Regards 
Srihari M 


Loader.
Live Chat Icon For mobile
Up arrow icon