buy now
log in
MindFusion

Q: I have an ASP.NET bar chart that shows the bars in groups. I am able to show labels under each bar but is it possible to show one label for each group?

A: Yes, that is possible if you use the ClusterLabels properties. You specify the labels as a single array of strings - each string is drawn in the middle of the bar group. Set the LabelType of the axis the bars are rendered on to AxisLabelType.CustomText.

 BarChart1.ClusterLabels = new List { "January", "February", "March"};
 BarChart1.XAxisSettings.LabelType = AxisLabelType.CustomText;

Q: Is it possible to control how much space is there around the chart?

A: Yes, it is possible - the PlotAreaMargins property does exactly that. It is a Margins object that sets the space at each 4 sides of the chart. Keep in mind that in this case the control does not calculate the space needed for the labels and your Margin must be big anough so they can fit in.

 BarChart1.PlotAreaMargins = new Margins(50.0F);

Q: I am using Charting for ASP.NET and want to show labels with more trailing zeros?

A: You should take a look at the AxisSettings.NumberFormat property, which uses the NumberFormat enumeration. If it doesn't have what you want you should set the property to NumberFormat.Custom and use NumberCustomFormat to specify the format of the numeric labels:

 BarChart1.YAxisSettings.NumberFormat = NumberFormat.Custom;
 BarChart1.YAxisSettings.NumberCustomFormat = "0.000";
Copyright © 2001-2024 MindFusion LLC. All rights reserved.
Terms of Use - Contact Us