Profile Picture

Expand surface chart to fill control

Posted By Andrew Jones 14 Years Ago
Author
Message
Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Andrew,

The easiest way to do that is to enable docking and turn off padding and margins - for example:

   NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

   // set to BoundsMode.Fit if you want the chart to retain aspect or BoundsMode.Stretch if the aspect can change
   chart.BoundsMode = BoundsMode.Fit;
   chart.Dock = DockStyle.Fill;

   // set zero padding & margins
   chart.Margins = new NMarginsL(0, 0, 0, 0);
   chart.Padding = new NMarginsL(0, 0, 0, 0);

   // in case of 3D configure chart to fit axis labels in the bounding box
   chart.Fit3DAxisContent = true;

Note that when using BoundsMode.Fit the chart will retain the aspect specified by the Width, Height, Depth properties of NCartesianChart. Otherwise (Stretch mode) the aspect will vary and the chart will try to occupy as much space as possible.

Hope this helps - questions or comments - please feel free...

 



Best Regards,
Nevron Support Team



Andrew Jones
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 4, Visits: 1

I'm using a surface chart with the legends and axis turned off. I'd like the chart to fill the entire control (which may get resized as the parent window changes size). I can see how to set the width & height using model units but is there any way I can get the chart to fill the entire control?

Andrew





Similar Topics


Reading This Topic