I tried this sample trying to solve a similar problem. I wanted to render a text label for every label that is an even number. Could not get it to work. Finally, I brute forced a list of labels and used the following code to solve it.
*****
int[] points = {1,5,2,3,6,9,4,16,3,17,8,2,25,22};
string[] labels = new string[points.Length];
for(int i = 0; i < points.Length; i++)
{
if(points[i] % 2 == 0)
labels[i] = points[i].ToString();
else
labels[i] = "";
}
for(int i = 0; i < labels.Length; i++)
{
chartControl1.PrimaryXAxis.Labels.Add (labels[i]);
}
chartControl1.PrimaryXAxis.ValueType = ChartValueType.Custom;
>Hi,
>
>The ChartFormatAxisLabel event of the ChartControl can be handled to provide custom labels for any of the Axes.
>
>http://www.syncfusion.com/Support/article.aspx?id=10455
>
>Sample:
>
>
F19339ChartAxisLabel_9534.zip
>
>// Add the handler
>this.chartControl1.ChartFormatAxisLabel += new ChartFormatAxisLabelEventHandler(this.chartControl1_ChartFormatAxisLabelEventHandler);
>
>// The event handler
>private void chartControl1_ChartFormatAxisLabelEventHandler(object sender,ChartFormatAxisLabelEventArgs args )
> {
> if(args.IsAxisPrimary && args.AxisOrientation == Orientation.Horizontal)
> {
> if(this.checkBox1.Checked && args.Value % 10 != 0)
> {
> args.Label = "";
> args.Handled = true;
> }
> }
> }
>
>Regards,
>
>Davis
>
>