c# - ASP chart StackedColumn100 add percent symbol (%) on values -


i have chart (using chart control build-in on .net):

enter image description here

how add percent sign (%) behind of values (for example 44 => 44%, 56 => 56% , on)


edit (after tried jstreet's sugesstions in comment): stackedcolumn100 chart values percentages.

tried <asp:series label="#val%">, got this: (notice 0 values showing don't want, used these codes hide 0 values initially):

protected void requestchart_customize(object sender, eventargs e)         {             //hide label value if 0             foreach (system.web.ui.datavisualization.charting.series series in requestchart.series)             {                 foreach (system.web.ui.datavisualization.charting.datapoint point in series.points)                 {                     if (point.yvalues.length > 0 && (double)point.yvalues.getvalue(0) == 0)                     {                         point.isvalueshownaslabel = false;                     }                 }             }         } 

enter image description here

tried <asp:series labelformat="p2">, got

enter image description here

this working me: labelformat="{0}%", change {0} {0.0} or {0.00} depend on how want display values.

btw, hide 0 values on chart, add customize event chart:

protected void requestchart_customize(object sender, eventargs e)         {             //hide label value if 0             foreach (system.web.ui.datavisualization.charting.series series in requestchart.series)             {                 foreach (system.web.ui.datavisualization.charting.datapoint point in series.points)                 {                     if (point.yvalues.length > 0 && (double)point.yvalues.getvalue(0) == 0)                     {                         point.isvalueshownaslabel = false;                     }                 }             }         } 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -