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

Chart not Displaying when placed on Tab Controller

I have the following code

@section ContentSection

{

<div>

@{Html.EJ().Tab("defaultTabs").Items(data =>

{

data.Add().ID("year").Text("Year Sales").ContentTemplate(@<div>

@{Html.EJ().Chart("chartYear")

.PrimaryXAxis(xAxis => xAxis.ValueType(AxisValueType.Category))

.PrimaryYAxis(yAxis => yAxis.ValueType(AxisValueType.Double)

.LabelFormat("$ {value}")

.Range(range => range.Min(0).Max(300).Interval(50)))

.Series(sr =>

{

sr.Name("2014 Sales")

.Type(SeriesType.Column)

.DataSource((System.Collections.IEnumerable)ViewBag.datasourceYear)

.XName("Xmonth")

.YName("Sales")

.YAxisName("Sales").Add();

})

.Render();}

</div>);

data.Add().ID("month").Text("Month Sales").ContentTemplate(@<div>

@{Html.EJ().Chart("chartMonth")

.PrimaryXAxis(xAxis => xAxis.ValueType(AxisValueType.Category))

.PrimaryYAxis(yAxis => yAxis.ValueType(AxisValueType.Double)

.LabelFormat("$ {value}")

.Range(range => range.Min(0).Max(300).Interval(50)))

.Series(sr =>

{

sr.Name("November Sales")

.Type(SeriesType.Column)

.DataSource((System.Collections.IEnumerable)ViewBag.datasourceMonth)

.XName("Xmonth")

.YName("Sales")

.YAxisName("Sales").Add();

})

.Render();}

</div>);

}).Render();}

}


The chart on the first tab displays just fine but when I click to the second tab the chart is not displayed. I verified the chart is working properly by putting both charts on the same page.

What do I need to do in order for the chart on the second tab to display correctly.



3 Replies

AB Akbar Basha K M Syncfusion Team October 23, 2014 12:25 PM UTC

Hi Fabio,

Thanks for using syncfusion product. We have analyzed the reported issue with our sample; we are not able to reproduce the issue. Can you please check with the attached sample.

If still you face the problem, please revert us by modifying the sample based on your application along with replication procedure. This would be helpful for us to serve you.

Please let us know if you have any concern.

Regards,

Akbar Basha KM.


Attachment: ASPMVCWrapper_91bbc64.zip


FM Fabio Melendez October 23, 2014 03:33 PM UTC

Here is a sample project where problem still exists

Attachment: MVCChartTabProblem_3bb374b7.zip


AB Akbar Basha K M Syncfusion Team October 24, 2014 10:03 AM UTC

Hi Fabio,
Thanks for your update. We are able to reproduce the reported issue, “When using tab control the chart width assigned as 0” and this has been included in our upcoming Volume 3 release which is expected to get rolled out in end of October 2014.
Please let us know if you have any concern.
Regards,
Akbar Basha KM.

Loader.
Live Chat Icon For mobile
Up arrow icon