We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Regarding chart axis labels

Hi

is it possible that i would label of primary axis moved in opposite direction but not move ticks marks

If i use "Chart.PrimaryXAxis.OpposedPosition = true" then Ticks and labels are both move is nay method in syncfusion 5.2 that only labels(labels means 10,20 ,30,40,50,60) on primary axis moves to opposite direction but tick marks does not move Plz tell me it is very-2 urgent try to reply me with in 24 hours i shall be thank ful for you?See attachedimage

Thanks



Line_c21170d.zip

1 Reply

MA Manohari Syncfusion Team September 8, 2008 04:18 AM UTC

Hi Rajan,

We regret very much for the delayed response. Currently we do not have direct Support to move XAxis labels to opposite Direction. However it is possible to acheive this by drawing Custom Ticks using ChartAreaPaint Event. Please refer to the sample code below.

Sample Code:

this.chartControl1.ChartAreaPaint += new PaintEventHandler(chartControl1_ChartAreaPaint);
}

void chartControl1_ChartAreaPaint(object sender, PaintEventArgs e)
{

float minX = this.chartControl1.ChartArea.RenderBounds.Left;
float maxX = this.chartControl1.ChartArea.RenderBounds.Right;
double interval = this.chartControl1.PrimaryXAxis.VisibleRange.Interval;
double min = this.chartControl1.PrimaryXAxis.VisibleRange.Min;
int intervals = this.chartControl1.PrimaryXAxis.VisibleRange.NumberOfIntervals;

for (int i = 0; i <= intervals; i++)
{
double point = min + (i * interval);
ChartPoint cp = new ChartPoint(point, 0);
float x = (float)this.chartControl1.ChartArea.GetPointByValue(cp).X;
float y = this.chartControl1.ChartArea.RenderBounds.Bottom;
if (x >= minX && x <= maxX)
{
e.Graphics.DrawLine(Pens.Red, new PointF(x, y), new PointF(x, y + this.chartControl1.PrimaryXAxis.TickSize.Height)); // To Draw Ticks
...
I have attached a sample that illustrates the same in this link below.

http://websamples.syncfusion.com/samples/Chart.Windows/F76355/Sample1.htm

Kindly let us know if this meets your requirement. Thanks for your patience.

Regards,
Manohari.R



Loader.
Live Chat Icon For mobile
Up arrow icon