1

I want to format the display of numeric values in an ASP.NET RadChart's tooltips. For example, instead of showing 100000, I want the text to read "1.0e5". For the axes, the property to set is as follows:

chart.InnerChart.PlotArea.YAxis.Appearance.CustomFormat = "0.##E+0";

There must be a similar property on the chartSeries to similarly format the tooltips, but so far I have failed to locate it. Does anyone know?

retrodrone
  • 5,850
  • 9
  • 39
  • 65

2 Answers2

1

For each ChartSeriesItem in the chart, you can set the ToolTip in the following manner:

e.SeriesItem.ActiveRegion.Tooltip = string.Format("{0:0.###e+0}", value);
retrodrone
  • 5,850
  • 9
  • 39
  • 65
  • Congratulations, you found it. That's worth a +1. However, it seems like a brute force way to have to do it. – Daniel May 24 '12 at 20:49
  • Indeed, I agree. Pls let me know if you think of a better way. Likewise, I'll post one if I can think it up. – retrodrone May 24 '12 at 22:00
0

I'm not sure which RadChart you are using. Here is an excerpt of code for an ASP.Net MVC RadChart.

.Tooltip(tooltip => tooltip
    .Visible(true)
    .Format("{0:0.##E+0}")
)
Daniel
  • 5,602
  • 4
  • 33
  • 36
  • Thanks, Daniel. I'm using the ASP.NET web forms version. But I think your snippet adjusts the single tooltip for the chart itself, not the many tooltips for all of the series points. I looked and there is no Tooltip property for ChartSeriesItem. Surely there must be a way. – retrodrone May 24 '12 at 19:07
  • In ASP.NET MVC, the code above formats the tooltips for all the series points. I will look at the web forms version to see if I can find anything similar. – Daniel May 24 '12 at 20:02