Hi Christopher,
Actually I am reading minimum and maximum value from database. So I need to pass that value instead of calculating it. Please suggest.
Also, like to know how to increase image (exporting chart to png format) resolution. How to store the chart/image in database?
Bottom and Custom Vertical Axis Label Start Position
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Bottom and Custom Vertical Axis Label Start Position
I'm afraid I don't know what to suggest because I don't know what you are expecting to see. Axis.SetMinMax works as expected, of that there is no doubt. That the values you pass to it do not produce results that you expect is a different matter. What are you expecting to see from the values you pass to Axis.SetMinMax?Priyanka wrote: Actually I am reading minimum and maximum value from database. So I need to pass that value instead of calculating it. Please suggest.
You can do this with the following:Priyanka wrote: Also, like to know how to increase image (exporting chart to png format) resolution.
Code: Select all
PNGFormat png = tChart1.Chart.Export.Image.PNG;
png.Height = 2000;
png.Width = 5000;
png.Save(@"D:\Trend.png");
I'm not sure how I can help you here, as TeeChart has no code which interacts with databases.Priyanka wrote: How to store the chart/image in database?
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Bottom and Custom Vertical Axis Label Start Position
Hi Christopher,
In the earlier trend image Y-axis is showing minimum value as 500. Even if I have set it to 0.3 in code. I am expecting Y-axis should be started from 0.3 (min) to 7500 (no issue with max value it is setting correctly). Basically I don't want chart to auto calculate values based on scale.
Is there any feature or property of tee chart to export it into binary format?
In the earlier trend image Y-axis is showing minimum value as 500. Even if I have set it to 0.3 in code. I am expecting Y-axis should be started from 0.3 (min) to 7500 (no issue with max value it is setting correctly). Basically I don't want chart to auto calculate values based on scale.
Is there any feature or property of tee chart to export it into binary format?
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Bottom and Custom Vertical Axis Label Start Position
One thing is the Axis.Minimum and Axis.Maximum, and another thing are the Axis labels. You can see that SetMinMax works using test code such as the following:Priyanka wrote: In the earlier trend image Y-axis is showing minimum value as 500. Even if I have set it to 0.3 in code. I am expecting Y-axis should be started from 0.3 (min) to 7500 (no issue with max value it is setting correctly). Basically I don't want chart to auto calculate values based on scale.
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
Line line = new Line(tChart1.Chart);
Random rnd = new Random();
for (int i = 0; i < 20; i++)
{
line.Add(i, rnd.Next(0, 8000));
}
tChart1.Axes.Left.SetMinMax(0.3, 7500);
tChart1.GetNextAxisLabel += TChart1_GetNextAxisLabel;
}
private void TChart1_GetNextAxisLabel(object sender, GetNextAxisLabelEventArgs e)
{
if (((Steema.TeeChart.Axis)sender).Equals(tChart1.Axes.Left))
{
e.Stop = false;
switch (e.LabelIndex)
{
case 0:
e.LabelValue = 0.3;
break;
case 1:
e.LabelValue = 500;
break;
case 2:
e.LabelValue = 3000;
break;
case 3:
e.LabelValue = 6000;
break;
case 4:
e.LabelValue = 7500;
break;
default:
e.Stop = true;
break;
}
}
}
This axis functionality is explained in the tutorials shipped with TeeChart.NET:
Yes, there are TeeChart's "ten" files explained in Tutorial 12.Priyanka wrote: Is there any feature or property of tee chart to export it into binary format?
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Bottom and Custom Vertical Axis Label Start Position
Hi Christopher,
Thanks. I will take a look at tutorials again.
I would like to know the label value format which supports decimal and negative values. Currently I am using "##0.##;{##0.##}". However, it is showing wrong format in case of negative values. i.e. for value -500 chart is showing {500}. Please suggest.
Thanks. I will take a look at tutorials again.
I would like to know the label value format which supports decimal and negative values. Currently I am using "##0.##;{##0.##}". However, it is showing wrong format in case of negative values. i.e. for value -500 chart is showing {500}. Please suggest.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Bottom and Custom Vertical Axis Label Start Position
You can try: "##0.##;{-##0.##}"Priyanka wrote: I would like to know the label value format which supports decimal and negative values. Currently I am using "##0.##;{##0.##}". However, it is showing wrong format in case of negative values. i.e. for value -500 chart is showing {500}. Please suggest.
These are standard .NET custom number formatting strings, as you can read here.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |