Group: Forum Members
Last Active: 4 Years Ago
Posts: 16,
Visits: 192
|
Hi , I want to change label arrow alignment to left horizontally . you can see it in attached snapshot that arrow of label pointing to upward vertically . How can I change arrow direction to horizontally left . For showing arrow I have used this code .- 73% of original size (was 687x19) - Click to enlarge  NPointSeries point = new NPointSeries (); & nbsp ;& nbsp ;& nbsp ;& nbsp ; point . Size = new NLength ( 0 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; _cartesianChart . Series . Add ( point ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; point . DataLabelStyle . Visible = true ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; point . DataLabelStyle . TextStyle . StringFormatStyle . VertAlign = VertAlign . Center ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; point . DataLabelStyle . Visible = true ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; point . UseXValues = true ; & nbsp ;& nbsp ;& nbsp ;& nbsp ;& nbsp ; point . Values . Add ( 142 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ;& nbsp ; point . XValues . Add ( 6 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; point . Labels . Add (" Some Label "); & nbsp ;& nbsp ;& nbsp ;& nbsp ; point . DataLabelStyle . TextStyle . BackplaneStyle . FillStyle . SetTransparencyPercent ( 100 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; point . DataLabelStyle . TextStyle . BackplaneStyle . StandardFrameStyle . Visible = false ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; point . DataLabelStyle . TextStyle . TextFormat = TextFormat . XML ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; point . DataLabelStyle . Format = "& lt ; label & gt ;";
|
Group: Forum Members
Last Active: Last Month
Posts: 3,055,
Visits: 4,055
|
Hi Shweta , You can change the text alignment using the following code : point . DataLabelStyle . TextStyle . StringFormatStyle . HorzAlign = HorzAlign . Left ; point . DataLabelStyle . VertAlign = VertAlign . Center ; Note that the second line specifies the vertical origin of the text relative to the data point . We hope this helps – let us know if you have any questions .
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 16,
Visits: 192
|
Hello sir , Thanks for reply , but I don ' t want to change text alignment . I want to change arrow direction of label from top to left / right side of data point with text . Is there any way to rotate / move arrow of label to left side . I have attached snapshot in which I have edited and added label in horizontal direction of line ( label with red color arrow and highlighted text ). How can I make label like this in horizontal direction of line . 73% of original size (was 687x19) - Click to enlarge 
|
Group: Forum Members
Last Active: Last Month
Posts: 3,055,
Visits: 4,055
|
Hi Shweta , Currently , you cannot control the distance from the point in the case of the horizontally aligned text . You can , however , achieve this result using a callout annotation - for example : & nbsp ;& nbsp ;& nbsp ; NChart chart = nChartControl1 . Charts [ 0 ]; & nbsp ;& nbsp ;& nbsp ;& nbsp ; NLineSeries line = new NLineSeries (); & nbsp ;& nbsp ;& nbsp ;& nbsp ; line . Values . Add ( 10 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; line . Values . Add ( 20 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; line . Values . Add ( 30 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; line . DataLabelStyle . Visible = false ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; chart . Series . Add ( line ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; NRectangularCallout callout = new NRectangularCallout (); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . Text = " Some Label "; & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . UseAutomaticSize = true ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . Anchor = new NDataPointAnchor ( line , 1 , System . Drawing . ContentAlignment . MiddleCenter , System . Drawing . StringAlignment . Center ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . ArrowLength = new NLength ( 40 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . ArrowBasePercent = 0 ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; chart . ChildPanels . Add ( callout ); It creates a callout that is on the right side of the point . The problem with this approach is that you ' ll also need to measure the text correctly in order to dynamically produce meaningful value for the arrow length property . Let us know if you meet any problems .
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 16,
Visits: 192
|
hello sir , Thank you for providing solution . Now I achieved the result but I also want to not show border on the text , you can see that in attached snapshot there is border outside the text . I tried to remove border from the text using this code but it does not work . can u please provide some solution how can i do this . NRectangularCallout callout = new NRectangularCallout (); & nbsp ;& nbsp ; callout . Text = " Some Label "; & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . UseAutomaticSize = true ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . Anchor = new NDataPointAnchor ( curve , 1 , System . Drawing . ContentAlignment . MiddleCenter , System . Drawing . StringAlignment . Center ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . ArrowLength = new NLength ( 40 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . ArrowBasePercent = 0 ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . TextStyle . BackplaneStyle . FillStyle . SetTransparencyPercent ( 100 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . TextStyle . BackplaneStyle . StandardFrameStyle . Visible = false ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . TextStyle . TextFormat = TextFormat . XML ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; _cartesianChart . ChildPanels . Add ( callout ); & nbsp ;& nbsp ; 73% of original size (was 687x19) - Click to enlarge 
|
Group: Forum Members
Last Active: Last Month
Posts: 3,055,
Visits: 4,055
|
Hi Shweta , In order to achieve this you need to set the stroke style width to zero and configure the ArrowStrokeStyle - the following code shows how to achieve this : & nbsp ;& nbsp ;& nbsp ; NRectangularCallout callout = new NRectangularCallout (); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . Text = " Some Label "; & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . UseAutomaticSize = true ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . Anchor = new NDataPointAnchor ( bar , 1 , System . Drawing . ContentAlignment . MiddleCenter , System . Drawing . StringAlignment . Center ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . ArrowLength = new NLength ( 40 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . ArrowBasePercent = 0 ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . TextStyle . TextFormat = TextFormat . XML ; & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . FillStyle . SetTransparencyPercent ( 100 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . StrokeStyle . Width = new NLength ( 0 ); & nbsp ;& nbsp ;& nbsp ;& nbsp ; callout . ArrowStrokeStyle = new NStrokeStyle ( 1 , Color . Black ); Let us know if you have any questions .
Best Regards, Nevron Support Team
|