Page 1 of 1

String horizontal axis and Label

Posted: Wed Aug 17, 2011 1:55 am
by 13050783
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?

Re: String horizontal axis and Label

Posted: Wed Aug 17, 2011 10:29 am
by 10050769
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,

Re: String horizontal axis and Label

Posted: Thu Aug 18, 2011 7:24 am
by 13050783
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?

Re: String horizontal axis and Label

Posted: Mon Aug 22, 2011 10:27 am
by yeray
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.

Re: String horizontal axis and Label

Posted: Wed Aug 24, 2011 7:05 am
by 13050783
This is the sample.

Re: String horizontal axis and Label

Posted: Thu Aug 25, 2011 1:37 pm
by 10050769
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 474 times
I hope will helps.

Thanks,

Re: String horizontal axis and Label

Posted: Fri Aug 26, 2011 8:18 am
by 13050783
Idon't known why this can work. Solution seems nothing about this problem. But whatever It really works.
Thank you.