I'm creating column charts using System.Web.UI.DataVisualization.Charting which have a variable number of series and X datapoint values.
I can turn value labels on using:
myChart.Series[0].IsValueShownAsLabel = true;
Depending on how many series and datapoints there are however, these labels can become unreadable. Is there a way to have value labels but only if they are readable?
A thought I had was along the lines of:
int datapointsCount = ?????;
int labelPixelSize = 15;
int chartPixelSize = ?????;
if ((myChart.Series.Count * datapointsCount * labelPixelSize) > chartPixelSize) {
foreach (Series mySeries in myChart.Series) {
mySeries.IsValueShownAsLabel = false;
}
}
This is pretty messy and far from ideal however.
Thanks!! ;)