Hi all
I have a View which display a Chart and it works great if I have a few rows but once I try to display around 30 rows, for instance, I would need to display a Bar Chart with 30 dates vertical line and 3 categories on horizontal line, everything gets squeezed.
Here is my code:
@(Html.Telerik().Chart(Model)
.Name("chartTop")
.Title(title => title.Text("Test").Visible(ViewBag.ShowTitle))
.Legend(legend => legend.Position(ViewBag.LegendPosition).Visible(ViewBag.ShowLegend))
.SeriesDefaults(series =>
{
series.Bar().Stack(ViewBag.Stack);
series.Column().Stack(ViewBag.Stack);
series.Line().Stack(ViewBag.Stack);
})
.Series(series =>
{
if (ViewBag.SeriesType == "bar")
{
series.Bar(s => s.Targets).Name("Target")
.Labels(labels => labels.Position(ViewBag.NumberBarColumnPosition).Font("12px Arial, sans-serif").Visible(true));
series.Bar(s => s.Failed).Name("Failed").Labels(true)
.Labels(labels => labels.Position(ViewBag.NumberBarColumnPosition).Font("12px Arial, sans-serif").Visible(true));
series.Bar(s => s.PowerOn).Name("Success").Labels(true)
.Labels(labels => labels.Position(ViewBag.NumberBarColumnPosition).Font("12px Arial, sans-serif").Visible(true));
}
else if (ViewBag.SeriesType == "column")
{
//ommited for brevity
}
else //Line chart
{
//ommited for brevity
}
})
.CategoryAxis(axis =>
{
axis.Categories(s => s.UpgradeDate);
//axis.Labels(l => l.Rotation(90));
})
.Tooltip(tooltip => tooltip.Visible(true))
.HtmlAttributes(new { style = "width: 600px; height: 2000px;" })
//.HtmlAttributes(new { style = "width:100%; height:100%;" })
)
Any ideas?
Thank you