String horizontal axis and Label

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
mks-ydi
Newbie
Newbie
Posts: 26
Joined: Mon Nov 10, 2008 12:00 am

String horizontal axis and Label

Post by mks-ydi » Wed Aug 17, 2011 1:55 am

How can I show strings on horizontal axis?
I found a function: add(double value,string txt), but label will be same with horizontal axis.
Can I set different label from horizontal axis and show strings on horizontal axis?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: String horizontal axis and Label

Post by Sandra » Wed Aug 17, 2011 10:29 am

Hello mks-ydi,
How can I show strings on horizontal axis?
I found a function: add(double value,string txt), but label will be same with horizontal axis.
I have made next code, and labels are changing depending as text you are adding. Therefore, it works fine for me.

Code: Select all

private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            Random rnd = new Random();
            for (int i = 0; i < 10; i++)
            {
                line1.Add(i, rnd.Next(100), "Values:" + i.ToString());
            }

        }
Could you please, check if previous code works as you want? On the other hand, I suggest you can take a look in the All Features\Welcome !\Axes\Custom Labels, where there is more examples.
Can I set different label from horizontal axis and show strings on horizontal axis?
I am not sure of understand what you want achieve. Please, can you explain exactly what do you want do?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

mks-ydi
Newbie
Newbie
Posts: 26
Joined: Mon Nov 10, 2008 12:00 am

Re: String horizontal axis and Label

Post by mks-ydi » Thu Aug 18, 2011 7:24 am

I'm sorry I haven't say clearly. It should be mark. Today I found when mark style is value, tee chart show the value with two significant digits.The precision is not enough for our project, are there any solutions for this problem?

By the way I found another bug of teechart:
1. Create a project.
2. Add a UpdatePanel on the page.
3. Add an button and teechart on the UpdatePanel.
4. Make the chart support zoom.
5. Run the project.
6. Zoom the chart.
7. Click the button. You can see chart will be zoomed again.

I'm sorry I don't have time to write a sample project for this. Could you write a sample project?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: String horizontal axis and Label

Post by Yeray » Mon Aug 22, 2011 10:27 am

Hello,
mks-ydi wrote:I'm sorry I haven't say clearly. It should be mark. Today I found when mark style is value, tee chart show the value with two significant digits.The precision is not enough for our project, are there any solutions for this problem?
You can use ValueFormat string to set it. Here it is an example:

Code: Select all

            WebChart1.Chart.Aspect.View3D = false;

            WebChart1.Chart.Legend.Visible = false;
            Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(WebChart1.Chart.Chart);

            Random r = new Random();
            line1.Add(r.NextDouble());
            for (int i = 1; i < 20; i++)
            {
                line1.Add(line1.YValues[i-1] + (r.NextDouble()/1000 - 0.00045));
            }

            WebChart1.Chart.Axes.Left.Labels.ValueFormat = "#0.0000";
mks-ydi wrote:By the way I found another bug of teechart:
1. Create a project.
2. Add a UpdatePanel on the page.
3. Add an button and teechart on the UpdatePanel.
4. Make the chart support zoom.
5. Run the project.
6. Zoom the chart.
7. Click the button. You can see chart will be zoomed again.

I'm sorry I don't have time to write a sample project for this. Could you write a sample project?
I'm trying to do it but I'm afraid I can't add the chart into the UpdatePanel. We'll be pleased to take a look at it when you'll find time to arrange a simple example project we can run as-is to reproduce the problem here. On the other hand, It looks similar to the discussion here, so I'd try what's suggested there.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

mks-ydi
Newbie
Newbie
Posts: 26
Joined: Mon Nov 10, 2008 12:00 am

Re: String horizontal axis and Label

Post by mks-ydi » Wed Aug 24, 2011 7:05 am

This is the sample.
Attachments
TeeChartBug2.zip
(153.6 KiB) Downloaded 475 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: String horizontal axis and Label

Post by Sandra » Thu Aug 25, 2011 1:37 pm

Hello mks-ydi,

Ok. I have modified your code and seems zoom works fine for me. Could you please, check if attach project works as you expected? If doesn't work as you expect please tell us exactly, what do you want application do?
TeeChartBug2.1.zip
(158.78 KiB) Downloaded 461 times
I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

mks-ydi
Newbie
Newbie
Posts: 26
Joined: Mon Nov 10, 2008 12:00 am

Re: String horizontal axis and Label

Post by mks-ydi » Fri Aug 26, 2011 8:18 am

Idon't known why this can work. Solution seems nothing about this problem. But whatever It really works.
Thank you.

Post Reply