Page 1 of 1

I have some import problem

Posted: Thu Dec 11, 2008 4:12 am
by 9637229
hi I want to import .ten file

but import has some problem

imported chart label title has changed and axes bottom background add black
color

I attached two chart image (original file and imported file) and ten file

My Sample Code
----------------------------------------------------------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Steema.TeeChart.Web; // Teechart
using System.IO; // Teechart
using System.Text; // stringbuilder
using System.Collections.Specialized; // HybridDictionary

namespace WebApplication1
{
/// <summary>
/// WebForm1에 대한 요약 설명입니다.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected Steema.TeeChart.Web.WebChart WC1010001;

private void Page_Load(object sender, System.EventArgs e)
{
// 여기에 사용자 코드를 배치하여 페이지를 초기화합니다.

if (File.Exists("d:\\test\\webapplication1\\chartimg\\WC1010001.ten"))
{
Steema.TeeChart.Chart ch = this.WC1010001.Chart; //차트 생성

ch.Import.Template.Load("d:\\test\\webapplication1\\chartimg\\WC1010001.ten");

ch.Legend.Shadow.Visible = false;
ch.Legend.CustomPosition = false;

//File.Delete("d:\\test\\webapplication1\\chartimg\\WC1010001.ten");
}
else
{
ChartCreate();
}
}

#region Web Form 디자이너에서 생성한 코드
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 이 호출은 ASP.NET Web Form 디자이너에 필요합니다.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void ChartCreate()
{
//****************************************************************************************************
// * 차트 생성
#region 차트 디자인 set
Steema.TeeChart.Chart ch = this.WC1010001.Chart; //차트 생성
MemoryStream tmpChart=new MemoryStream();

// 3D
ch.Aspect.View3D = false;

// Head title
ch.Header.Visible = false;

// panel
ch.Panel.MarginTop = 10;
ch.Panel.MarginBottom = 10;
ch.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
ch.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;

// legend
ch.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom;
ch.Legend.Pen.Visible = false;
ch.Legend.Shadow.Visible = false;
ch.Legend.Symbol.Width = 12;
ch.Legend.CustomPosition = true;
ch.Legend.Top = 160;
ch.Legend.Left = 30;
ch.Legend.ColumnWidthAuto = false;
ch.Legend.ColumnWidths[0] = 66;
ch.Legend.MaxNumRows = 1;

// wall
ch.Walls.Visible = true;
ch.Walls.Back.Transparency = 0;
ch.Walls.Back.Transparent = false;

// wall axes
ch.Axes.Left.AxisPen.Width = 1;
ch.Axes.Left.MinorTicks.Visible = false;

ch.Axes.Right.AxisPen.Width = 1;
ch.Axes.Right.Grid.Visible = false;
ch.Axes.Right.Ticks.Visible = false;
ch.Axes.Right.MinorTicks.Visible = false;

ch.Axes.Bottom.AxisPen.Width = 0;
ch.Axes.Bottom.MinorTicks.Visible = false;
ch.Axes.Bottom.TicksInner.Visible = false;
ch.Axes.Bottom.Grid.Visible = false;

// 단위표시
Steema.TeeChart.Tools.Annotation annotation1 = new Steema.TeeChart.Tools.Annotation(ch);
annotation1.Shape.Visible = false;
annotation1.Text = "(%)";
annotation1.Top = 0;
annotation1.Left = 10;

Steema.TeeChart.Tools.Annotation annotation2 = new Steema.TeeChart.Tools.Annotation(ch);
annotation2.Shape.Visible = false;
annotation2.Text = "(원)";
annotation2.Top = 0;
annotation2.Left = 310;

#endregion

Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(ch.Chart);
line1.LinePen.Width = 2;
line1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;

Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(ch.Chart);
line2.LinePen.Width = 2;

Steema.TeeChart.Styles.Line line3 = new Steema.TeeChart.Styles.Line(ch.Chart);
line3.LinePen.Width = 2;

ch.Axes.Bottom.Labels.Items.Clear(); // bottom label set

//Test Data
string [] DataBottom = {"07/12","08/03","08/06","08/09","08/12"};
int [] DataLine1 = {10,15,20,25,30};
int [] DataLine2 = {12,14,29,15,38};
int [] DataLine3 = {2,10,40,12,21};

for(int i = 0 ; i < 5 ; i++)
{
line1.Add(i, DataLine1);
line2.Add(i, DataLine2);
line3.Add(i, DataLine3);

Steema.TeeChart.AxisLabelItem lb_Axis = new Steema.TeeChart.AxisLabelItem(ch.Chart);

lb_Axis = ch.Axes.Bottom.Labels.Items.Add(i, DataBottom.ToString());
}

//ch.Export.Template.Save(tmpChart);
ch.Export.Template.Save(@"d:\Test\Webapplication1\\chartimg\WC1010001.ten");
}
}
}

----------------------------------------------------------------------------------

teeChart Version : TeeChart for .NET v2 Update Build version
Release Notes 8th October 2008
TeeChart.NET version 2
Build 2.0.3203.23271
Compiled in .NET Framework 1.1
Build 2.0.3203.23272
Compiled in .NET Framework 2.0

I wrote this problem at newsgroup
and according to advise from newsgroup, I added some code
just like
ch.Import.Template.Load("d:\\test\\webapplication1\\chartimg\\WC1010001.ten");
ch.Legend.Shadow.Visible = false;
ch.Legend.CustomPosition = false;

but bottom label still remain shadow...

please help me
[/img]

Posted: Thu Dec 11, 2008 10:44 am
by narcis
Hi blueday321,
teeChart Version : TeeChart for .NET v2 Update Build version
Release Notes 8th October 2008
TeeChart.NET version 2
Build 2.0.3203.23271
Compiled in .NET Framework 1.1
Build 2.0.3203.23272
Compiled in .NET Framework 2.0

I wrote this problem at newsgroup
and according to advise from newsgroup, I added some code
just like
ch.Import.Template.Load("d:\\test\\webapplication1\\chartimg\\WC1010001.ten");
ch.Legend.Shadow.Visible = false;
ch.Legend.CustomPosition = false;

but bottom label still remain shadow...
Code I posted in the newsgroups works fine here using latest TeeChart for .NET v2 and v3 releases.

That's what I get here with latest v2 release and code below:

Image

Code: Select all

    public Form1()
    {
      InitializeComponent();
			InitializeChart();
    }

		private void InitializeChart()
		{
			tChart1.Import.Template.Load(@"c:\temp\WC1010001_005930.ten");

			tChart1.Legend.Shadow.Visible = false;
			tChart1.Legend.CustomPosition = false;

			tChart1.Series[0].XValues.DateTime = true;
			tChart1.Axes.Bottom.Labels.DateTimeFormat = "yy/MM";
			tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;

			tChart1.Export.Image.JPEG.Save(@"c:\temp\WC1010001_005930.jpg");
		}
If problem persists could you please 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.

thank you Narcís, but i don't know what was wrong

Posted: Fri Dec 12, 2008 2:22 am
by 9637229
thank a lot Narcís

but I still don't know what was wrong~

so i attached sample project at upload page

file name is WebApplication1.zip

please find out my fault at my sample project

have a nice day

thank you~

Posted: Fri Dec 12, 2008 11:00 am
by narcis
Hi blueday321,

Thanks for the example project.

We could reproduce the problem here using the *.ten file you sent. However, generating it here, using latest TeeChart for .NET v3 release available at the client area, worked fine without the need of setting Legend.Shadow=false.

Then I found that the TeeChart assembly you were using corresponds to TeeChart for .NET v2, with which the problem also occurs here.

So it's fixed with v3. Anyway, I'll add the issue to the bug list as a v2 defect.