Jump to content
Software FX Community

Point Labels and Max Y on Gantt Stacked 1000 chart - .NET Internet


User (Legacy)

Recommended Posts

I'm trying to migrate from ChartFX 5.5IE to ChartFX .NET Internet.

I'm trying to display a horizontal stacked (100%) bar chart using the code

below.

This code results in two strange problems:

1. I can't get the point labels to show up in the chart for each series.

2. I can't get the chart to go out to 100% - it stops at 90. I've gt data

in each series that sums to 100.

Thanks -

Jim

just_jt@hotmail.com

private void Page_Load(object sender, System.EventArgs e)

{

// Put user code to initialize the page here

Chart1.Gallery=Gallery.Gantt;

Chart1.Chart3D=true;

Chart1.Perspective = 10; //make top slightly larger, consistent with

looking down

Chart1.Stacked = Stacked.Stacked100;

Chart1.View3D = true;

Chart1.View3DDepth=50; // depth of bars

Chart1.Titles[0].Text = "Sample Chart with ChartFX.NET";

Chart1.AngleX=15; //controls your vertical perspective

Chart1.AngleY=0; //controls your horizontal perspective and rotates chart

Chart1.AxisY.LabelsFormat.CustomFormat="###";

Chart1.AxisY.Max = 100;

Chart1.AxesStyle = AxesStyle.Frame3D;

Chart1.Series[0].Color = Color.Red;

Chart1.Series[4].Color = Color.Firebrick;

Chart1.Series[2].Color = Color.Blue;

Chart1.Series[3].Color = Color.Beige;

Chart1.Series[1].Color = Color.AliceBlue;

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

Chart1.Value[0,0]=20;

Chart1.Value[1,0]=20;

Chart1.Value[2,0]=20;

Chart1.Value[3,0]=20;

Chart1.Value[4,0]=20;

Chart1.Value[0,1]=5;

Chart1.Value[1,1]=5;

Chart1.Value[2,1]=10;

Chart1.Value[3,1]=30;

Chart1.Value[4,1]=50;

Chart1.Value[0,2]=1;

Chart1.Value[1,2]=2;

Chart1.Value[2,2]=3;

Chart1.Value[3,2]=4;

Chart1.Value[4,2]=90;

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

Chart1.PointLabels=true;

Chart1.PointLabelAlign = SoftwareFX.ChartFX.LabelAlign.Center |

SoftwareFX.ChartFX.LabelAlign.VCenter;

Chart1.RightGap=100;

Chart1.Series[0].PointLabels=true;

Chart1.Series[1].PointLabels=true;

Chart1.Series[2].PointLabels=true;

Chart1.Series[3].PointLabels=true;

Chart1.Series[4].PointLabels=true;

Chart1.GetHtmlData(600,200,"Png");

}

Link to comment
Share on other sites

The problems you are experiencing are due to a timing issue when setting the

stacked property, setting this property recalculates the scale so that all

your data is visible, because of that it may not behave properly if you set

the stacked property before passing the data. Moving the Stacked assignment

to the end of your code (before the GetHtmlData) fixes both issues.

You can safely remove the per-series PointLabels assignment since you are

also setting the "global" PointLabels property.

Note that in previous builds (including probably the one you are using)

there is a bug that can occur when setting one of the gaps (this issue has

been fixed and will be included in the next service pack). If your TopGap or

other gaps are behaving erratically you may want to comment out the line

where you set the RightGap.

--

Regards,

JC

Software FX Support

"Jim" <just_jt@hotmail.com> wrote in message

news:ICnx10cWCHA.3136@webserver1.softwarefx.com...

> I'm trying to migrate from ChartFX 5.5IE to ChartFX .NET Internet.

>

> I'm trying to display a horizontal stacked (100%) bar chart using the code

> below.

> This code results in two strange problems:

> 1. I can't get the point labels to show up in the chart for each series.

> 2. I can't get the chart to go out to 100% - it stops at 90. I've gt data

> in each series that sums to 100.

>

> Thanks -

>

> Jim

> just_jt@hotmail.com

>

> private void Page_Load(object sender, System.EventArgs e)

> {

> // Put user code to initialize the page here

> Chart1.Gallery=Gallery.Gantt;

> Chart1.Chart3D=true;

> Chart1.Perspective = 10; //make top slightly larger, consistent with

> looking down

> Chart1.Stacked = Stacked.Stacked100;

> Chart1.View3D = true;

> Chart1.View3DDepth=50; // depth of bars

> Chart1.Titles[0].Text = "Sample Chart with ChartFX.NET";

> Chart1.AngleX=15; //controls your vertical perspective

> Chart1.AngleY=0; //controls your horizontal perspective and rotates

chart

> Chart1.AxisY.LabelsFormat.CustomFormat="###";

> Chart1.AxisY.Max = 100;

> Chart1.AxesStyle = AxesStyle.Frame3D;

> Chart1.Series[0].Color = Color.Red;

> Chart1.Series[4].Color = Color.Firebrick;

> Chart1.Series[2].Color = Color.Blue;

> Chart1.Series[3].Color = Color.Beige;

> Chart1.Series[1].Color = Color.AliceBlue;

>

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

> Chart1.Value[0,0]=20;

> Chart1.Value[1,0]=20;

> Chart1.Value[2,0]=20;

> Chart1.Value[3,0]=20;

> Chart1.Value[4,0]=20;

>

> Chart1.Value[0,1]=5;

> Chart1.Value[1,1]=5;

> Chart1.Value[2,1]=10;

> Chart1.Value[3,1]=30;

> Chart1.Value[4,1]=50;

>

> Chart1.Value[0,2]=1;

> Chart1.Value[1,2]=2;

> Chart1.Value[2,2]=3;

> Chart1.Value[3,2]=4;

> Chart1.Value[4,2]=90;

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

> Chart1.PointLabels=true;

> Chart1.PointLabelAlign = SoftwareFX.ChartFX.LabelAlign.Center |

> SoftwareFX.ChartFX.LabelAlign.VCenter;

> Chart1.RightGap=100;

> Chart1.Series[0].PointLabels=true;

> Chart1.Series[1].PointLabels=true;

> Chart1.Series[2].PointLabels=true;

> Chart1.Series[3].PointLabels=true;

> Chart1.Series[4].PointLabels=true;

> Chart1.GetHtmlData(600,200,"Png");

>

>

> }

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...