Hi Kamen,
My apologies for the delay in responding to you.
You can able to display custom labels using Interface IChartAxisLabelModel in chart control.
Able to set the custom label for axis by following methods. It is common for all chart types.
Method 1:
this.chartControl1.PrimaryXAxis.LabelsImpl = new LabelModel(new string[] { "NYSC", "DELL", "LLC", "CITI", "ORCL", "CSCO" });
this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.Custom;
Method 2:
this.chartControl1.PrimaryXAxis.Labels.Clear();
this.chartControl1.PrimaryXAxis.TickLabelsDrawingMode = Syncfusion.Windows.Forms.Chart.ChartAxisTickLabelDrawingMode.UserMode;
this.chartControl1.PrimaryYAxis.TickLabelsDrawingMode = Syncfusion.Windows.Forms.Chart.ChartAxisTickLabelDrawingMode.AutomaticMode;
for (int i = 0; i < labels.Length; i++)
{
this.chartControl1.PrimaryXAxis.Labels.Add(new Syncfusion.Windows.Forms.Chart.ChartAxisLabel(labels[i], Color.Crimson, new Font("Times New Roman", font_size), i, "", Syncfusion.Windows.Forms.Chart.ChartValueType.Custom));
}
Method 3:
private void chartControl1_ChartFormatAxisLabel(object sender, ChartFormatAxisLabelEventArgs e)
{
if (e.AxisOrientation == ChartOrientation.Vertical )
{
if (e.Value == 0)
e.Label = "NYSC";
else if (e.Value == 1)
e.Label = "DELL";
else if (e.Value == 2)
e.Label = "LLC";
else if (e.Value == 3)
e.Label = "CITI";
else if (e.Value == 4)
e.Label = "ORCL";
else if (e.Value == 5)
e.Label = "CSCO";
else
e.Label = "";
e.Handled = true;
}
}
Please take a look at the attached sample.
http://websamples.syncfusion.com/samples/Chart.Windows/F60789_1/main.htmIn the above sample, the range of the data on x axis is 1/1/06 to 31/12/06, and we have monthly ticks positioned at 1/1/06, 2/1/06, ..., 12/1/06. When I select any one of the dates in combobox, It will displayed 24 ticks to remain at those locations in the data.
Let me know if this helps.
Regards,
Rashidha.