With the Infragistics ASP.NET MVC DataChart helper, currency formatting is usually handled through axis label and tooltip customization rather than directly inside the series configuration. You can format the numeric Y-axis labels by using a JavaScript label formatter that prepends the dollar sign and limits values to two decimal places, such as returning “$” + value.toFixed(2) inside the NumericY axis label settings. For tooltips, create a custom tooltip template and format the displayed value using JavaScript so numbers appear like $10.00 when users hover over chart columns. The legend text is generally taken from the series title, so if you want consistent currency display, focus on formatting axis labels and tooltip content. This approach is similar to cnc machining processes where precise parameter configuration ensures accurate output, just like proper chart formatting ensures correct financial data presentation.
Column Chart formatting
New DiscussionI have a simple category chart created. I’m trying to format the label, tooltip and numeric values as currency format but i can’t find where to do it using the Asp.Net MVC Helper.
Here’s the code:
<div id="columnChart" class="chart">
@(
Html.Infragistics()
.DataChart(Model.ChartSummary.AsQueryable())
.ID("WeeklyPayments")
.Width("100%")
.Height("400px")
.Title("Payments last 7 days")
.Legend(legend => legend.ID("legend"))
.Axes(axes =>
{
axes.CategoryX("xAxis")
.Label(item => item.FormattedDate);
axes.NumericY("yAxis")
.Title("$ Payment Totals");
})
.Series(series =>
{
series.Column("Payment Type").ValueMemberPath(item=>item.CreditCardAmount).Title("Credit Card").XAxis("xAxis").YAxis("yAxis").ShowTooltip(true);
series.Column("IVR").ValueMemberPath(item => item.IVRAmount).Title("IVR").XAxis("xAxis").YAxis("yAxis").ShowTooltip(true);
series.Column("Check").ValueMemberPath(item => item.CheckAmount).Title("Check").XAxis("xAxis").YAxis("yAxis").ShowTooltip(true);
series.Column("Other").ValueMemberPath(item => item.OtherAmount).Title("Other").XAxis("xAxis").YAxis("yAxis").ShowTooltip(true);
})
.DataBind()
.Render()
)
</div>
<div id="legend" class="legend"></div>
I would like the Legend, and tooltips to display in a currency format ie. $10.00
Sign In
to post a reply
Replies
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Favorites
0 Replies
9 Created On
Jan 28, 2025 Last Post
4 hours, 32 minutes ago