Page 1 of 3
Problem in axis title.
Posted: Fri Jul 25, 2008 9:08 am
by 14047415
Hi,
I am mapping tchart.Axes.Left axis and adding custom labels to it.
Problem:
1) The formatting which is applying on custom label, same are also get
applied on axis title. Title should be of differently formatted.
2) Title almost coming nearby or on the axis. It should be away from axis
labels.
Here is code:
Axis ZAxis = tchart.Axes.Left;
ZAxis.Title.Text = "Test";
ZAxis.Title.Font.Name = "Arial";
ZAxis.Title.Font.Size = 20;
ZAxis.Title.Font.Color = Color.Blue;
ZAxis.Title.TextAlign = StringAlignment.Center;
ZAxis.SetMinMax(0,100);
ZAxis.Labels.Items.Clear();
double start = 0.0;
double end = 100.0;
double majorGridPoint = 10.0;
int labelItemNo = 0;
while (start <= end)
{
ZAxis.Labels.Items.Add(start);
ZAxis.Labels.Items[labelItemNo].Font.Name = "ArialBlack";
ZAxis.Labels.Items[labelItemNo].Font.Size = 10;
ZAxis.Labels.Items[labelItemNo].Font.Color = Color.Green;
ZAxis.Labels.Items[labelItemNo].Font.Bold = true;
start = start + majorGridPoint;
labelItemNo++;
}
Note: Same code is working for tchart.Axes.Bottom and tchart.Axes.Depth
Thanks,
-Raed
Posted: Mon Jul 28, 2008 9:08 am
by narcis
Hi Raed,
1) The formatting which is applying on custom label, same are also get
applied on axis title. Title should be of differently formatted.
I'm not able to reproduce the issue here using latest TeeChart for .NET v3 release available at the client area. Which TeeChart version are you using?
2) Title almost coming nearby or on the axis. It should be away from axis labels.
You can solve that using this:
Posted: Mon Jul 28, 2008 1:16 pm
by 14047415
Hi,
1) The formatting which is applying on custom label, same are also get
applied on axis title. Title should be of differently formatted.
For this, I tried with the new version also. Same problem is coming.
The scale label like 0,2,4,..., 20 should be in let say blue color
and title like "Z" should be in let say red color.
Meaning both should have different formatting.
-Raed
Posted: Mon Jul 28, 2008 1:21 pm
by narcis
Hi Raed,
That's what I got here using the code snippet you posted. Would you be so kind to send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://
www.steema.net/steema.public.attachments newsgroup or at our
upload page.
Thanks in advance.
Posted: Mon Jul 28, 2008 1:45 pm
by 14047415
Hi,
I have sent you the view attachment.
Please look at this.
-Raed
Posted: Mon Jul 28, 2008 2:04 pm
by narcis
Hi Raed,
Thans for the screenshot. Yes, I can see the problem there. However, to be able to find a solution we would need to reproduce the problem here and debug it so we would really appreciate if you could arrange a simple example project we can run "as-is" to reproduce the issue here.
Thanks in advance.
Posted: Wed Jul 30, 2008 12:08 pm
by 14047415
Hi,
I have uploaded an example. Please look into this.
There is a problem txt file in zip "3DPlotsProblem.txt".
When you run the application, you just click on "save/view" button.
For any trail and error, you have to make change in the code.
Thanks
-Raed
Posted: Wed Jul 30, 2008 1:34 pm
by narcis
Hi Raed,
Thanks for your project. Please find below the answers to your problems:
1. Unable to draw surface with default color, even all the points(x,y,z) are properly added in surface class. (Look at view)
This is because of the "Center Point" addition, commenting in the line that adds that point makes the surface being displayed in the chart:
Code: Select all
//Center Point
#region Center Point
double centerZVal = ((centerLeftZVal) + (centerTopZVal)) / 2;
//SurfaceSeries[surfaceIndex].Add(yValue, centerZVal, xValue, Convert.ToString(yValue));
SurfaceSeries[surfaceIndex].Marks.Visible = true;
SurfaceSeries[surfaceIndex].Marks.Font.Color = Color.Red;
#endregion
The problem is that that point doesn't keep the grid structure Surface series should have as I described
here.
To achieve what you are trying to do you could try using 2 surface series. One for the "regular" points and the other for "center" points.
It would also help viewing the surface changing your elevation and rotation settings.
2. Unable to format Z-Axis labels like Y-Axis or X-Axis. (Look at view)
The difference here is that you use custom labels for chart's left axis. How would you exactly want labels to be displayed there?
Since all Y values are the same in the surface, you may better use SetMinMax method combinded with Increment property to set left axis scale instead of using custom labels.
3. Unable to format -ve scale labels on axis. (Look at view)
Sorry but I don't understand what do you mean here. Could you please give us some more details?
Thanks in advance.
Posted: Thu Jul 31, 2008 5:48 am
by 14047415
Quote 1: If I remove center points. I am able to draw the surface connecting points. But the problem is, it is not creating center line between each bin surface. So, I calculate center point also.
Quote 2: If I go for SetMinMax and increment property, whatever be the
minimum value, it is taking 0 on scale. I want to display given minimum value as start.
Example: SetMinMax(5,20)
Scale should be start from 5 and ends with 20.
So, I am using custom labels.
-Raed
Posted: Thu Jul 31, 2008 7:30 am
by narcis
Hi Raed,
Quote 1: If I remove center points. I am able to draw the surface connecting points. But the problem is, it is not creating center line between each bin surface. So, I calculate center point also.
I see, no surface pen lines are drawn for x value = 470 (your Y axis). We will investigate the issue here and will get back to you when we have further news.
Quote 2: If I go for SetMinMax and increment property, whatever be the minimum value, it is taking 0 on scale. I want to display given minimum value as start.
Example: SetMinMax(5,20)
Scale should be start from 5 and ends with 20.
This works fine for me here using this code:
This also depends on the increment you set for the axis, this works fine for me here:
Code: Select all
private void DisplayZAxis()
{
//Z-Axis
Steema.TeeChart.Axis ZAxis = ChartDisplay.Axes.Left;
ZAxis.Title.Font.Name = "Arial";
ZAxis.Title.Font.Size = 14;
ZAxis.Title.Font.Color = Color.Green;
ZAxis.Title.Text = "Z Axis";
ZAxis.SetMinMax(-5, 100);
//ZAxis.Increment = 23;
//For Major Grid
double start = -5;
double end = 100;
ZAxis.SetMinMax(start, end);
ZAxis.MinimumOffset = 10;
ZAxis.MaximumOffset = 10;
//double zAxisIncrement = 23;
//ZAxis.Labels.Items.Clear();
//int labelItemNo = 0;
//string zAxisFormat;
//while (start <= end)
//{
// zAxisFormat = "{0:#.#####}";//formatting for Z Axis - decimal places like 0.00000
// string zAxisValue = String.Format(zAxisFormat, start);
// ZAxis.Labels.Items.Add(start, zAxisValue);
// ZAxis.Labels.Items[labelItemNo].Font.Name = "Arial";
// ZAxis.Labels.Items[labelItemNo].Font.Size = 14;
// ZAxis.Labels.Items[labelItemNo].Font.Color = Color.Red;
// ZAxis.Labels.Items[labelItemNo].Font.Bold = false;
// start = start + zAxisIncrement;
// labelItemNo++;
//}
}
Posted: Thu Jul 31, 2008 7:52 am
by narcis
Hi Raed,
I see, no surface pen lines are drawn for x value = 470 (your Y axis). We will investigate the issue here and will get back to you when we have further news.
I've been doing some more tests and I've found the same happens with an empty chart with the same data. I imagine the problem is that x values increments are not the same for each cell. I've added this issue (TF02013295) to the defect list to be enhanced for next releases.
Posted: Fri Aug 01, 2008 7:17 am
by 14047415
I have uploaded the 3DChartCode.rar file to give you more details on my problem. I am not able to see the simple display of bin surface with proper lines on my system. Please look into the code and let me know the solution.
Regards,
Sanyog
Posted: Fri Aug 01, 2008 8:07 am
by narcis
Hello Sanyog,
Do you mean that you can get grid line in the red-marked area to appear?
If so, thats issue TF02013295 I told you in my previous reply.
Thanks in advance.
Posted: Fri Aug 01, 2008 8:17 am
by 14047415
Yes NarcĂs,
I want to have grid line which is missing in the plot. If it is possible to get all horizontal and vertical lines in grid please tell me the work around(solution).
Regards,
Sanyog
Posted: Fri Aug 01, 2008 8:52 am
by narcis
Hi Sanyog,
In that case, as a workaround, you can make surface's Pen not visible and manually draw the lines in TChart's AfterDraw event like this:
Code: Select all
void ChartDisplay_AfterDraw(object sender, Graphics3D g)
{
foreach (Steema.TeeChart.Styles.Series s in ChartDisplay.Series)
{
if (s is Steema.TeeChart.Styles.Surface)
{
Steema.TeeChart.Styles.Surface surfa = ((Steema.TeeChart.Styles.Surface)s);
surfa.Pen.Visible = false;
for (int i=0; i < surfa.Count; i++)
{
double tmpZVal = surfa.ZValues[i];
if (tmpZVal < surfa.MaxZValue())
{
g.Line(surfa.CalcXPos(i), surfa.CalcYPos(i), surfa.CalcZPos(i),
surfa.CalcXPos(i), surfa.CalcYPos(i), ChartDisplay.Axes.Depth.CalcPosValue(surfa.MaxZValue()));
}
double tmpXVal = surfa.XValues[i];
if (tmpXVal < surfa.MaxXValue())
{
g.Line(surfa.CalcXPos(i), surfa.CalcYPos(i), surfa.CalcZPos(i),
surfa.CalcXPosValue(surfa.MaxXValue()), surfa.CalcYPos(i), surfa.CalcZPos(i));
}
}
}
}
}
However, using this there's a little offset between the manually painted lines and surface's brush
.