Profile Picture

Changing the zoom level of NLabel control during export

Posted By Irina 8 Years Ago
Author
Message
Irina
Problem Posted 8 Years Ago
View Quick Profile
Junior Member

Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 23, Visits: 306
Hi,
When exporting a chart control to an image, I can specify the desired size of the image. If this size is less than the size of the control, the chart will be zoomed out, but the NLabel control will have the same size. Is it possible to change the zoom level of the NLabel control based on the specified dimensions during export?

Nevron Support
This post has been flagged as an answer
Posted 8 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi Irina,
Yes you can use relative units to specify the size of the header - for example:

   nChartControl1.Panels.Clear();

   NLabel label = new NLabel("Some Label");
   label.BoundsMode = BoundsMode.Fit;
   label.TextStyle.FontStyle.EmSize = new NLength(5, NRelativeUnit.RootPercentage);
   label.DockMode = PanelDockMode.Top;
   nChartControl1.Panels.Add(label);

   NCartesianChart chart = new NCartesianChart();
   chart.DockMode = PanelDockMode.Fill;
   nChartControl1.Panels.Add(chart);

   NBarSeries bar = new NBarSeries();
   bar.Values.Add(10);
   bar.Values.Add(20);
   bar.Values.Add(30);
   chart.Series.Add(bar);

Alternatively you can simply set the font size depending on the export image size.


Best Regards,
Nevron Support Team



Irina
Posted 8 Years Ago
View Quick Profile
Junior Member

Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 23, Visits: 306
Hi,
Your approach works. Thank you!




Similar Topics


Reading This Topic