Hi Lubos,
We regret very much for the delayed response. Please find our responses to your queries below.
1) It is possible to move the Axis lines and labels to a specified values by specifying the offset value to the axis. ChartAxis.Offset will move the axis according to the value specified.
Sample code:this.chartControl1.PrimaryXAxis.DateTimeOffset = new TimeSpan(60); // for DateTime values
this.chartControl1.PrimaryXAxis.Offset = 5; // for Double values
2) It is also possible to draw custom Labels and Grid at the specified position by using the ChartAreaPaint event.
Sample code:this.chartControl1.ChartAreaPaint += new PaintEventHandler(chartControl1_ChartAreaPaint);
}
void chartControl1_ChartAreaPaint(object sender, PaintEventArgs e)
{
if (showCustomGridLines)
{
float minX = this.chartControl1.ChartArea.RenderBounds.Left;
...
...
for (int i = 0; i < intervals; i++)
{ ...
...
ChartPoint cp = new ChartPoint(dt, 0);
float x = (float)this.chartControl1.ChartArea.GetPointByValue(cp).X;
float y = this.chartControl1.ChartArea.RenderBounds.Bottom;
if (x >= minX && x <= maxX)
{
PointF pnt = new PointF(x, y + this.chartControl1.PrimaryXAxis.TickSize.Height);
e.Graphics.DrawString(dateX, this.chartControl1.PrimaryXAxis.Font, new SolidBrush(Color.Blue), new PointF(x - (sz.Width / 2), y + this.chartControl1.PrimaryXAxis.TickSize.Height + 4 + (sz.Height / 2))); // To Draw Labels
Pen p = new Pen(Color.FromArgb(0, 0, 255));
e.Graphics.DrawLine(Pens.Blue, new PointF(x, y), new PointF(x, y + this.chartControl1.PrimaryXAxis.TickSize.Height)); // To Draw Ticks
e.Graphics.DrawLine(p, new PointF(x, this.chartControl1.ChartArea.RenderBounds.Bottom), new PointF(x, this.chartControl1.ChartArea.RenderBounds.Top));
}
....
....
I have attached the sample that illustrates the above two methods in this link below.
http://websamples.syncfusion.com/samples/Chart.Windows/F75532/Sample1.htmKindly let us know if this meets your requirements. Thanks for your patience.
Regards,
Manohari.R