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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Fix chart first point to origine

Thread ID:

Created:

Updated:

Platform:

Replies:

129798 Apr 4,2017 09:20 AM UTC Apr 5,2017 01:39 PM UTC ASP.NET MVC 1
loading
Tags: Chart
Selem Charfi
Asked On April 4, 2017 09:20 AM UTC

I am using a Chart Control into Asp MVC project (column type)
I would like that the first point will be drawn at the origin point.
I look at internet and the only solution is to used DateTime lable on XAxis.
Actually, my X Axis type is not date time (I have to use string type).
Regards,
Selem



Dharanidharan Dharmasivam [Syncfusion]
Replied On April 5, 2017 01:39 PM UTC

Hi Selem, 

Thanks for contacting Syncfusion support. 

We have analyzed your query. We would like to let you know that, in our previous releases, the column series (first and last point) get clipped and rendered, but this is not the correct behavior, actually the column has to visible fully, so we have added the interval with start and end points by inbuild and now the column will not be clipped. This is the current behavior of our chart control. 

Also your requirement can be achieved as workaround. Render the chart in numeric axis and by using AxesLabelRendering event, the text of the PrimaryXAxis can be changed and also you need to specify the range for PrimaryXAxis to render chart from origin, as depicted in the below code snippet. 

ASP.NET MVC [C#]: 

@(Html.EJ().Chart("container") 
        .PrimaryXAxis(pr => pr.Range(ra => ra.Max(7).Min(1).Interval(1)).ValueType(AxisValueType.Double)) 
        //... 
        .AxesLabelRendering("labelRender") 
 ) 
 
function labelRender(sender) { 
        var xLabel = ["USA", "China", "Japan", "Australia", "France", "Germany", "Italy", "Sweden"] 
        if (sender.data.axis.orientation == "horizontal") { 
            window.count = ej.util.isNullOrUndefined(window.count) ? 0 : window.count + 1; 
            sender.data.label.Text = xLabel[window.count]; 
        } 
    } 

Screenshot: 
 
 
Sample for reference can be find from below link. 
 
Thanks, 
Dharani. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;