Problems with charts


#1

Hi,

i have some problems with creating some charts.

1. The legend is shown in my diagram but the description is wrong. There is written for each “row” of my datasource “Row n” (e.g. n = 1 to 5). When resseting the datasource manual in excel the text i need is shown in the legend correct. It this a user error or a bug?

2. “chart.ValueAxis.Title.Rotation = 90;” seems not to be working!?

3. Question: In Excel i can set for the bars an description (Value, Categoryname, DataRowname). Is this with aspose possible to? I want in each bar the value of it (e.g. 20 or 42)

4. Is it possible to set the charts-painting area like the legend.x value? I want to have my barchart not on the left of the whole chart because on the left there should be other thins like legend an some other text…

Thanks for support!

-Stefan


#2

Hi Stefan,

1. Please email me your file created by Aspose.Excel and the file created by hand. I will investigate it. And could you post your code for this issue here?

2. Yes. It doesn’t work now. But it will work in the next hotfix before the start of next week.

3. Please try the following code:

//Show value
for(int i = 0; i < chart.NSeries.Count; i ++)
{
chart.NSeries[i].DataLabels.IsValueShown = true;
}

//Show category name
for(int i = 0; i < chart.NSeries.Count; i ++)
{
chart.NSeries[i].DataLabels.IsCategoryNameShown = true;
}

Now Value and CategoryName cannot show concurrently.

3. chart.Legend.Position = LegendPositionType.Left;
Then legend shows on the left and chart shows on the right.


#3

Hi Laurence, many thanks for your support!

1. I will e-Mail these two files in a few minutes…

2. That’s fine!

3. This code works but one adjust question: How to set the font in the bars? Now they are black and outside of my bar one the left and right! I have to set them smaller and other colored…

4. Your solution is a workarround. It will not work for me.
I have to explain:
On my sheet on the top is a table with one “descript-column” (“A”) and n “data-columns”.
The data-columns have all the same width. Now i want to set each bar exactly under the values in the table.
If i take your solution the legend is shown on the left. By giving the legend the required width it will work, you have right! But this required width is to small for my legend, the values will be multiline formatted and this is undesired. Therefore i have to set the legent on the top-right corner and under the chart. If i do this, my bar-chart (what’s the exactly name of this part of the whole chart?) appears on the left. To get it exactly under the values of my table i have to move it some columns or pixel to the right, but how to do this?

One more time many thanks for support!

Regards, Stefan

p.s. I will e-Mail the two excel-files to excel@aspose.com


#4

Hi Stefan,

Now I understand your need. About 3 and 4, I will provide api to set font for data labels and set position of chart. It will be availabe before the end of next week.

Thanks for your patience.


#5

Stefan,

I got your file. I will investigate it right now.

About your another question:

I have inquired before some weeks how to set the sheetname with " ", “-” and some other chars. Is this corrected yet?

The answer is yes. A hotfix including this feature will be released before the start of next week.


#6

Hi Stefan,

About the legend of series, please try these:

chart.NSeries[0].Name = “=A3”;
chart.NSeries[1].Name = “=A4”;

or

chart.NSeries[0].Name = “Test”;
chart.NSeries[1].Name = “Gesamtstückzahl”;


#7

Hi Laurence,
your Solution for my legends works great!

Posted by Laurence:
"Now I understand your need. About 3 and 4, I will provide api to set font for data labels and set position of chart. It will be availabe before the end of next week."

Maybe you can add in this step setting width and height of the inner-chart [with inner-chart i mean the part with the bars or lines…]
This would be great!

Thanks and Regards, Stefan


#8

Hi Stefan,

Please try the following code:

chart.Legend.Position = LegendPositionType.Top;

Hotfix 1.8.7 is release. It fixed the Range.SetOutlineBorder issue and you can use “chart.ValueAxis.Title.Rotation = 90;”.
Please download it and have a try.

Now I am working on your other feature requests.


#9

Hi Laurence,

i have downloaded this new hotfix 1.8.7 but “chart.ValueAxis.Title.Rotation = 90;” isn’t working for me!

My code:
<BR>chart.CategoryAxis.Title.Text = "Kalenderwochen"; <BR>chart.ValueAxis.Title.Rotation = 90;<BR>chart.ValueAxis.Title.Text = "Anzahl Fzg. (Anlieferung Montage) pro KW";<BR>

For the other features (1. set font for data labels, 2. set position of chart (! inner-chart !) and maybe 3. “Conditional Formatting” for cellvalues) you have called a release-date end of week (03/21/2004). Is this deadline supportable? My question is because of i have to outreach this date.

Regards, Stefan


#10

It’s a small bug for rotation. I will fix it in the next release.

Now please change your code to the following and rotation will take effect.

chart.CategoryAxis.Title.Text = “Kalenderwochen”;
chart.ValueAxis.Title.Rotation = 90;
chart.ValueAxis.Title.Text = “Anzahl Fzg. (Anlieferung Montage) pro KW”;
chart.ValueAxis.Title.TextFont.Color = Color.Black;

About other features you mentioned, you are right. The deadline will be 03/21/2004. Now thanks for your waiting.


#11

Hi Laurence,

sorry for numerous questions!!!

Is following code already supported by api? It has no effect for my charts.

chart.ValueAxis.Title.X = 0;
chart.ValueAxis.Title.Y = 100;
chart.ValueAxis.Title.Height = 50;
chart.ValueAxis.Title.Width = 200;
chart.ValueAxis.Title.TextHorizontalAlignment = TextAlignmentType.Left;

Much obliged, Stefan


#12

Hi Stefan,

I will do it ASAP. If possible, it will be included in this week’s release. Otherwise, it will be available in next week.