How to ensure full size graph ?


Author
Message
Joël Golinucci
Joël Golinucci
Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)
Group: Forum Members
Posts: 30, Visits: 61
Hi again,

Sorry to spam the forum with this third topic in a row but I thought this might need to be ask in a separate topic.

How can I make my graph take the whole available space in the NChart object ? Chart is 3D, but for now only seen with an OrthogonalTop projection.

I need no axis or walls at all, but setting their visible property to false doesn't seems to be enough.

Here is the code I use to create the chartControl and the chart object.


Protected Sub CreateGraph()
SyncLock fLockForChart
' Define the chart control (place holder for the graph)
fChartControl = New NChartControl()
fChartControl.Charts.Clear()
fChartControl.Name = String.Format("chartControl_{0}", fSubPile.ToString())
fChartControl.Dock = DockStyle.Fill
fChartControl.Margin = New Padding(0)
fChartControl.Padding = New Padding(0)
fChartControl.BackgroundStyle.FrameStyle.Visible = False
AddHandler fChartControl.Click, AddressOf Chart_Click
AddHandler fChartControl.MouseDown, AddressOf Chart_MouseDown

Dim zMin As Integer = fSubPile.Parent.DimMinZ.Value, zMax As Integer = Integer.Parse(fSubPile.Parent.DimMaxZ.Value) + Integer.Parse(fDataStorage.CellDimZ.Value)
' Define the graph and set its parameters
fChart = New NCartesianChart()
fChart.Series.Clear()
fChart.Name = String.Format("nGraph_{0}", fSubPile.ToString())
fChart.Enable3D = True
fChart.Projection.SetPredefinedProjection(PredefinedProjection.OrthogonalTop)
fChart.LightModel.SetPredefinedLightModel(PredefinedLightModel.None)
fChart.BackgroundFillStyle = New NColorFillStyle(Color.LightBlue) ' For screenshot on Nevron Forum only
fChart.Dock = DockStyle.Fill
fChart.Location = New NPointL(0, 0)
fChart.BoundsMode = BoundsMode.Stretch
fChart.Padding = New NMarginsL(0)
fChart.Margins = New NMarginsL(0)
fChart.Height = zMax - zMin
fChart.Axes(StandardAxis.PrimaryY).View = New NRangeAxisView(New NRange1DD(zMin, zMax))
For Each wall As NChartWall In fChart.Walls
'wall.Visible = False ' This is commentend to show the diffrence between screenshots
wall.Width = 0
Next
'For Each axis As NCartesianAxis In fChart.Axes
' axis.Visible = False ' This is also commented only for the screenshot
'Next

' Define the point series
fRangeSeries = New NRangeSeries()
fRangeSeries.Name = String.Format("nPointSeries_{0}", fSubPile.ToString())
fRangeSeries.InflateMargins = False
fRangeSeries.DataLabelStyle.Visible = False
fRangeSeries.Legend.Mode = SeriesLegendMode.None
fRangeSeries.BorderStyle.Width = New NLength(0)
fRangeSeries.UseXValues = True
fRangeSeries.UseZValues = True
fRangeSeries.Shape = BarShape.Bar


' Add the serie to the graph, the graph to its place holder and the whole to the panel (subPileView)
fChart.Series.Add(fRangeSeries)
fChartControl.Charts.Add(fChart)
Me.Controls.Add(fChartControl)
End SyncLock
End Sub



On the attached screenshot you will see that we are still able to see the blue background (with axis visible and not). What do I need to change to have the plot covering the blue area ?


Thanks for your help,

Best regards,

Joël
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 Joel,

1. I had to replace it with this:
fChart.Dock = DockStyle.Fill

Sorry for this - the upcoming 2014.1 release has renamed this property in order to avoid using System.Windows.Forms enums in chart DOM.

2) Why are we using the value 50 in the chart width and depth ?

It can be any value however it's good to keep the chart model bounds in the range 20-100 in order for them to be in the viewing frustrum. The model values hare are just used to define an aspect.

3) What is the point of naming the scale configurator title ? Especially if we are going to hide it after ?

That should be removed from the code as it is not required.

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

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Joël Golinucci - 11 Years Ago
Nevron Support - 11 Years Ago
Joël Golinucci - 11 Years Ago
Nevron Support - 11 Years Ago
Joël Golinucci - 11 Years Ago
Joël Golinucci - 11 Years Ago
Nevron Support - 11 Years Ago
Joël Golinucci - 11 Years Ago
Nevron Support - 11 Years Ago
Joël Golinucci - 11 Years Ago
Joël Golinucci - 11 Years Ago
Nevron Support - 11 Years Ago
Joël Golinucci - 11 Years Ago
Nevron Support - 11 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search