Profile Picture

Hierarchical axes and label fitmodes

Posted By Ricardo Sousa 14 Years Ago
Author
Message
Ricardo Sousa
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 10, Visits: 1
Hi,

Can someone explain me how to use the following properties, and if they can be used together:

FirstRowFitModes, GroupRowFitModes;
FirstRowRangeFitMode, GroupRowRangeFitMode

NHierarchicalScaleNode.LabelStyle.


My question is: should I define the labels in the LabelStyle for each node or only define the First and Group properties.
In all my samples they don't work together, if I set Angle for each node the First and Group FitModes are ignored.
As I clear enough?

Best Regards,
Ricardo Sousa

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 Ricardo,

The first two propertis - FirstRowFitModes, GroupRowFitModes define how the scale behaves when there are overapping labels in the first row or any of the group rows (if present). When you have some of the "rotate" fit strategies they ignore angle label settings when overlapping occurs:

NChart chart = nChartControl1.Charts[0];


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

NHierarchicalScaleConfigurator hierScale = new NHierarchicalScaleConfigurator();
NHierarchicalScaleNode groupNode1 = new NHierarchicalScaleNode();

groupNode1.Text = "Group 1";
NHierarchicalScaleNode groupNode2 = new NHierarchicalScaleNode();
groupNode2.Text = "Group 2";
NHierarchicalScaleNode node11 = new NHierarchicalScaleNode();
node11.Length = 1;
node11.Text = "Node 1";
node11.LabelStyle.Angle = new NScaleLabelAngle(90);

NHierarchicalScaleNode node12 = new NHierarchicalScaleNode();
node12.Length = 1;
node12.Text = "Node 2";

NHierarchicalScaleNode node13 = new NHierarchicalScaleNode();
node13.Length = 1;
node13.Text = "Node 3";

NHierarchicalScaleNode node14 = new NHierarchicalScaleNode();
node14.Length = 1;
node14.Text = "Node 4";

groupNode1.ChildNodes.Add(node11);
groupNode1.ChildNodes.Add(node12);
groupNode2.ChildNodes.Add(node13);
groupNode2.ChildNodes.Add(node14);

hierScale.Nodes.Add(groupNode1);
hierScale.Nodes.Add(groupNode2);

hierScale.FirstRowFitModes = new LabelFitMode[] { LabelFitMode.Rotate30 };
hierScale.GroupRowFitModes = new LabelFitMode[] { LabelFitMode.Rotate30 };

chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = hierScale;

Similarly FirstRowRangeFitMode, GroupRowRangeFitMode define how the labels fit in the range they occupy. When it becomes smaller than the label you may want to wrap, rotate or auto scale:

hierScale.GroupRowRangeFitMode = RangeLabelFitMode.AutoFlip;
hierScale.FirstRowRangeFitMode = RangeLabelFitMode.AutoFlip;

Since range fitting will practically disable overlapping (as each label fits in its range) it will also discard the settings fit mode.

To summarize FirstRowFitModes and GroupRowFitModes defines how labels behave when they overlap where FirstRowRangeFitMode and GroupRowRangeFitMode defines how labels fit inside their range. If they do fit there should be no overlapping.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic