[CSHTML]
<script src="~/Scripts/ej/i18n/ej.culture.es-ES.min.js"></script>
<div id = "ControlRegion">
<div>
@(Html.EJ().Chart("containerStackedChart")
.Locale("es-ES") //For localizing labels to a specific culture
//Display numbers in y-axis based on localized settings
.PrimaryYAxis(pr => pr.LabelFormat("n0").Title(tl => tl.Text("Unidades")))
//. . . Other code for Chart
)
</div>
</div> |
ASP.NET MVC:
@(Html.EJ().Chart("containerStackedChart")
.Locale("es-ES")
.PrimaryYAxis(pr => pr.LabelFormat("n0").Title(tl => tl.Text("Unidades")))
.PrimaryXAxis(pr => pr.Title(tl => tl.Text("Gerências")).MajorGridLines(mr => mr.Visible(false)))
.CommonSeriesOptions(cr => cr.Type(SeriesType.StackingColumn).EnableAnimation(true)
.Tooltip(tt => tt.Visible(true).Format("#series.name# <br/> #point.x# : #point.y# Unidades")))
.Series(sr =>{sr.Points(pt =>
{
pt.X("Ger 2").Y(900000).Add();
pt.X("Ger 4").Y(800020).Add();
pt.X("Ger 6").Y(800080).Add();
pt.X("Ger 8").Y(700025).Add();
}).Name("Faturado").Fill("#2A80B9").Add();
sr.Points(pt =>
{
pt.X("Ger 2").Y(190000).Add();
pt.X("Ger 4").Y(220006).Add();
pt.X("Ger 6").Y(190004).Add();
pt.X("Ger 8").Y(250000).Add();
}).Name("Em Carteira").Fill("#2ECD71").Add();
sr.Points(pt =>
{
pt.X("Ger 2").Y(250000).Add();
pt.X("Ger 4").Y(140005).Add();
pt.X("Ger 6").Y(190000).Add();
pt.X("Ger 8").Y(220000).Add();
}).Name("Meta").Fill("#E94649").Add();
})
.IsResponsive(true)
.Enable3D(false)
.SideBySideSeriesPlacement(false)
.CanResize(true)
.Load("loadTheme")
.Title(tt => tt.Text("Gráfico Meta Mensal"))
.Size(sz => sz.Height("300"))
.Legend(lg => { lg.Visible(true).Position(LegendPosition.Bottom); })
)
|