Profile Picture

hierarchical scale display with own text length

Posted By james kouthon 14 Years Ago
Author
Message
james kouthon
Posted 14 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

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

Hi,

I would like to display a hierarchical scale with Nevron WinForm (using Q3 2008 version for VS2005).

I have some problems to resize the "column" of text in the second level of nodes (there will be arbitrarily long strings not known at compile time).

 

Here is the code I used (modified from the sample provided with the library):

                                           

NHierarchicalScaleConfigurator scale =

new NHierarchicalScaleConfigurator ();

            NHierarchicalScaleNodeCollection nodes = scale.Nodes;

            for (int i = 0; i < 8; i++)

            {

                NHierarchicalScaleNode yearNode = new NHierarchicalScaleNode

 (1, "jkhghgkgjkgjk  ");

                yearNode.LabelStyle.TickMode = RangeLabelTickMode.Separators;

                nodes.AddChild (yearNode);

                for (int j = 0; j < 4; j++)

                {

                 /* here I would like display horizontal text who

                        scale with text length*/

                    NHierarchicalScaleNode quarterNode = new NHierarchicalScaleNode (1, "Q54dfdf

                          sqd qsd qs dsqsd sqd qds dsffdsfsdfdsdfsdfsdf");

                    quarterNode.LabelStyle.TickMode =

                            RangeLabelTickMode.Separators;

                  NScaleLabelAngle angle = new NScaleLabelAngle (0);

                  quarterNode.LabelStyle.Angle = angle;

                  yearNode.ChildNodes.AddChild (quarterNode);

 

                }

            }

            scale.CreateSeparatorForEachLevel = true;

            nChartControl1.Charts[0].Axis(

StandardAxis.PrimaryX).ScaleConfigurator = scale;

            nChartControl1.Refresh ();

 

Can you help me ?

 



Attachments
testHierarchicalGraph.jpg (60 views, 114.00 KB)
bob milanov
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

Group: Forum Members
Last Active: 6 Months Ago
Posts: 153, Visits: 11

Hi James,

One way to fix this is to set the the labels angle in Scale coordinate space:

NScaleLabelAngle angle = new NScaleLabelAngle (ScaleLabelAngleMode.Scale, 0);

That way the labels will be rotated and will wrap automatically. The alternative is to insert line breaks in the text:

"First line \n Second Line"

Hope this helps - let me know if you meet any problems.

Best regards,

Bob

 





Similar Topics


Reading This Topic