Profile Picture

Multiple charts with linked X-Axis: How to force same Axis-Label-Size for all Charts

Posted By joern kunze 7 Years Ago

Multiple charts with linked X-Axis: How to force same Axis-Label-Size...

Author
Message
joern kunze
Problem Posted 7 Years Ago
View Quick Profile
Junior Member

Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)Junior Member (13 reputation)

Group: Forum Members
Last Active: 4 Months Ago
Posts: 86, Visits: 221
Hello Experts,

Problem: X-Axis Labels have different font size for multiple charts with linked X-Axis (Chart.Fit2DAxisContent = true)

I have alligned 3 charts next to each other:
https://www.nevron.com/forum/uploads/images/5c944cdf-1d00-45d8-8151-b731.jpg
 
=> I would like to have X Axis Label font size for middle and left Chart same as for the first Chart ("2017_02")
Due to some automatic size setting the middle and left Chart X Axis Label size is much smaller.


I use the following settings for the charts:

for (i = 0; i < iChartCount; i++) {
          _oChart[i].Fit2DAxisContent = true;
...
          _oChart[i].Axis(StandardAxis.PrimaryX).ScaleConfigurator.LabelFitModes = new LabelFitMode[]{ LabelFitMode.Rotate90};
}
....

//----- link axes
for (i = 0; i < iChartCount; i++) {
for (int iSlave = 0; iSlave < iChartCount; iSlave++) {
      if (iSlave != i) {
          _oChart[i].Chart.Axis(StandardAxis.PrimaryX).Slaves.Add(_oChart[iSlave].Chart.Axis(StandardAxis.PrimaryX));
          _oChart[i].Chart.Axis(StandardAxis.PrimaryY).Slaves.Add(_oChart[iSlave].Chart.Axis(StandardAxis.PrimaryY));
      }
}
}     

// Refresh
   _NevronChart.document.Calculate();
    _NevronChart.document.RecalcLayout(_NevronChart.View.Context);
    _NevronChart.Refresh();


// test
    NLinearScaleConfigurator oXScale = (NLinearScaleConfigurator)_NevronChart.Charts[0].Axis(StandardAxis.PrimaryX).ScaleConfigurator;
    NTextStyle hTextStyle = oXScale.LabelStyle.TextStyle;
    string sFontSize = hTextStyle.FontStyle.EmSize.ToString(); // always 9pt for all charts
==> sFontSize  is the same for all 3 Charts - but obviously the displayed size is not the same

So how do I force the middle and left Chart to have the same X Axis Label size like the first left hand Chart ?

Thanks for help,
Joern





Similar Topics


Reading This Topic