Rotate Chart Label


Author
Message
Stilianos Roussis
Stilianos Roussis
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 3, Visits: 48
Hello,

I am new to the Nervon Chart.

I am using the code below to rotate a chart label clockwise but the label is only partly shown.

   label1.TextStyle.Orientation = -90  
   label1.Location = New NPointL(70, 10)  
   NChartControl3.Panels.Add(label1)  

chart3 = New NCartesianChart()  
chart3.SetPredefinedChartStyle(PredefinedChartStyle.HorizontalLeft)  
chart3.BoundsMode = BoundsMode.Stretch
 
Can you please provide some assistance as to what I am doing wrong?

Thank you

Reply
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Stilianos,
We would recommend you to use Fill docking for the chart and a relative position for the second label so that it is attached to the right side of the first label docked to the right. In order for this to work you need to add the chart after you add the labels. The following code shows how to achieve this:

  NChartControl1.Panels.Clear()

  Dim label1 As NLabel = New NLabel("Label 1 Text")
  label1.DockMode = PanelDockMode.Right
  label1.TextStyle.Orientation = -90
  label1.FitAlignment = ContentAlignment.TopRight
  label1.Margins = New NMarginsL(0)
  NChartControl1.Panels.Add(label1)

  Dim label2 As NLabel = New NLabel()
  label2.Text = "Label 2 Text"
  label2.Location = New NPointL(New NLength(100, NRelativeUnit.ParentPercentage), New NLength(100, NRelativeUnit.ParentPercentage))
  label2.TextStyle.Orientation = -90
  'label2.FitAlignment = ContentAlignment.BottomRight
  label2.ContentAlignment = ContentAlignment.TopLeft
  label2.FitMode = TitleFitMode.Clip
  label2.Margins = New NMarginsL(0)
  label1.ChildPanels.Add(label2)

  Dim chart3 As New NCartesianChart()
  chart3.SetPredefinedChartStyle(PredefinedChartStyle.HorizontalLeft)

  Dim barSeries As New NBarSeries
  barSeries.Values.Add(10)
  barSeries.Values.Add(20)
  chart3.Series.Add(barSeries)
  chart3.BoundsMode = BoundsMode.Stretch
  chart3.DockMode = PanelDockMode.Fill
  chart3.Margins = New NMarginsL(5)
  NChartControl1.Panels.Add(chart3)

Hope this helps - let us know if you meet any problems or have any questions.


Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search