Profile Picture

How to ensure full size graph ?

Posted By Joël Golinucci 11 Years Ago

How to ensure full size graph ?

Author
Message
Joël Golinucci
Posted 11 Years Ago
View Quick Profile
Junior Member

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
Last Active: 10 Years Ago
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

Replies



Similar Topics


Reading This Topic

3 active, 3 guests, 0 members, 0 anonymous.
No members currently viewing this topic!