Jump to content
Software FX Community

problem with legend and text at the bottom of the chart


User (Legacy)

Recommended Posts

hi all,

I have a little problem while trying to create a footer for a a webchart.

When I'm using the following code, the result for the footer is always

reversed, the string for the copyright is always above the string for some

other information, the same when I use a user legend, the legend is

positioned at the bottom and the two strings are above the legend. Is there

any possiblity to change this?

thanks

ulrich

Here is the code I used for my test chart (or see the file attached):

System.Random r;

r= new System.Random();

Chart1.Gallery = SoftwareFX.ChartFX.Gallery.Bar;

Chart1.Chart3D = true;

Chart1.MarkerSize = 4;

Chart1.LineWidth = 1;

Chart1.OpenData(SoftwareFX.ChartFX.COD.Values, 1, 5);

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

{

Chart1.Value[0, j] =r.NextDouble()* 100;

}

Chart1.CloseData(SoftwareFX.ChartFX.COD.Values);

SoftwareFX.ChartFX.Internet.Server.TitleDockable title = Chart1.Titles[0];

title.DrawingArea = true;

title.Text = "Title";

title.Font = new System.Drawing.Font("Arial", 10,

System.Drawing.FontStyle.Regular);

title.Alignment = System.Drawing.StringAlignment.Center;

title.DockArea = SoftwareFX.ChartFX.DockArea.Top;

title = Chart1.Titles[1];

title.DrawingArea = true;

title.Text = "some other information";

title.Font = new System.Drawing.Font("Arial", 10,

System.Drawing.FontStyle.Regular);

title.Alignment = System.Drawing.StringAlignment.Center;

title.DockArea = SoftwareFX.ChartFX.DockArea.Bottom;

title = Chart1.Titles[2];

title.DrawingArea = true;

title.Text = "Copyright ... ";

title.Font = new System.Drawing.Font("Arial", 5,

System.Drawing.FontStyle.Regular);

title.Alignment = System.Drawing.StringAlignment.Center;

title.DockArea = SoftwareFX.ChartFX.DockArea.Bottom;

Link to comment
Share on other sites

1) To change the order of the titles you either just swap your titles 1 and

2 or assign:

title.LineAlignment = StringAlignment.Near;

To both.

2) The legend box will always be outside of the chart area which includes

the titles. You can create titles in the legend box too, this way you can

achieve a title that is at the very bottom of the control. For example:

chart1.SerLegBox = true;

chart1.SerLegBoxObj.Titles[0].Text = "Copyright...";

chart1.SerLegBoxObj.Titles[0].DockArea = DockArea.Bottom;

chart1.SerLegBoxObj.Docked = Docked.Bottom;

--

FP

Software FX, Inc.

post-2107-13922364605515_thumb.png

Link to comment
Share on other sites

thanks for your help, it's working fine

regards

ulrich

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:vzL3MAq$CHA.3020@webserver1.softwarefx.com...

> 1) To change the order of the titles you either just swap your titles 1

and

> 2 or assign:

>

> title.LineAlignment = StringAlignment.Near;

>

>

>

> To both.

>

> 2) The legend box will always be outside of the chart area which includes

> the titles. You can create titles in the legend box too, this way you can

> achieve a title that is at the very bottom of the control. For example:

>

> chart1.SerLegBox = true;

>

> chart1.SerLegBoxObj.Titles[0].Text = "Copyright...";

>

> chart1.SerLegBoxObj.Titles[0].DockArea = DockArea.Bottom;

>

> chart1.SerLegBoxObj.Docked = Docked.Bottom;

>

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...