Hi,
I'm trying to scale the legend palette logarithmically using code but this doesn't seem to work. It does work in the designer on the left axis, but apparently not in code. I'm actually not convinced that <legendpalette>.Chart.Axes.Left.... works at all. Can you confirm whether or not it should?
Thanks,
Michael
Logarithmic scaling using Legend Palette?
-
- Newbie
- Posts: 12
- Joined: Mon Feb 06, 2012 12:00 am
Re: Logarithmic scaling using Legend Palette?
Hello Michael,
Ok. I have made an example using left axis with logarithmic scale and surface with aleatory values and the Legend palette tool, update, see next:
Can you tell us if previous code help you to achieve as you want? If it doesn't help you, please explain us, step to step, what you want achieve because we try to make a simple example, if it is possible.
Thanks,
Ok. I have made an example using left axis with logarithmic scale and surface with aleatory values and the Legend palette tool, update, see next:
Code: Select all
Steema.TeeChart.Styles.Surface series1;
Steema.TeeChart.Tools.LegendPalette legendPalette1;
private void InitializeChart()
{
series1 = new Surface(tChart1.Chart);
series1.Add(1, 1.1E1, 1.5);
series1.Add(2, 1.12E2, 1.5);
series1.Add(3, 1.13E3, 1.5);
series1.Add(1, 2.2E1, 1.6);
series1.Add(2, 2.2E2, 1.6);
series1.Add(3, 2.2E3, 1.6);
series1.Add(1, 3.31E1, 1.75);
series1.Add(2, 3.32E2, 1.75);
series1.Add(3, 3.33E3, 1.75);
series1.Add(1, 4.31E1, 2);
series1.Add(2, 4.32E2, 2);
series1.Add(3, 4.33E3, 2);
series1.IrregularGrid = true;
series1.ValueFormat = "0.00#E 00";
legendPalette1 = new Steema.TeeChart.Tools.LegendPalette(tChart1.Chart);
legendPalette1.Series = series1;
tChart1.Axes.Left.Logarithmic = true;
tChart1.Axes.Left.Labels.ValueFormat = "0.00#E 00";
legendPalette1.Pen.Visible = false;
legendPalette1.Transparent = true;
tChart1.Draw();
legendPalette1.Left = (int)tChart1.Axes.Bottom.IEndPos 20;
tChart1.Panel.MarginRight = 25;
tChart1.Legend.Visible = false;
}
Thanks,
Best Regards,
Sandra Pazos / 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 |
-
- Newbie
- Posts: 12
- Joined: Mon Feb 06, 2012 12:00 am
Re: Logarithmic scaling using Legend Palette?
Hi Sandra,
Unfortunately that example does not really help me. I will try and explain with more detail. I am drawing a color grid with the x and y axes being linear, and color representing a 3rd dimension. I have applied my own palette using the AddPalette() and ClearPalette() methods, and the color grid itself works quite well.
I want to add a legend palette to this to show the values that correspond with the different colours. By default the left and right axes on the legend palette have a linear scale. I want to change this to a logarithmic scale, so that the smaller values are emphasised.
When I look at the legend palette's properties in the designer, there is an Axes tab. If I select the Left Axis and the Scales tab inside the Axes tab, there is a Logarithmic check box. I had hoped that if I checked this box then I would get a logarithmic scale on the legend palette, however this does not seem to work. I'm not sure if it is meant to work or not, but it would be useful if it did.
Let me know if I need to clarify my issue any further.
Michael
Unfortunately that example does not really help me. I will try and explain with more detail. I am drawing a color grid with the x and y axes being linear, and color representing a 3rd dimension. I have applied my own palette using the AddPalette() and ClearPalette() methods, and the color grid itself works quite well.
I want to add a legend palette to this to show the values that correspond with the different colours. By default the left and right axes on the legend palette have a linear scale. I want to change this to a logarithmic scale, so that the smaller values are emphasised.
When I look at the legend palette's properties in the designer, there is an Axes tab. If I select the Left Axis and the Scales tab inside the Axes tab, there is a Logarithmic check box. I had hoped that if I checked this box then I would get a logarithmic scale on the legend palette, however this does not seem to work. I'm not sure if it is meant to work or not, but it would be useful if it did.
Let me know if I need to clarify my issue any further.
Michael
Re: Logarithmic scaling using Legend Palette?
Hello Michael,
Thanks for your information. I have added the problem in the bug list report with number[TF02016049]. We will try to fix it for next maintenance releases of TeeChart.Net.
Thanks,
Thanks for your information. I have added the problem in the bug list report with number[TF02016049]. We will try to fix it for next maintenance releases of TeeChart.Net.
Thanks,
Best Regards,
Sandra Pazos / 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 |
-
- Newbie
- Posts: 12
- Joined: Mon Feb 06, 2012 12:00 am
Re: Logarithmic scaling using Legend Palette?
I see that someone has attempted to fix this problem (ie TF02016049), however I am yet to get it to work. To turn on logarithmic scaling on the legend palette I have attempted to do it both via the editor at design time, and run time, and programmatically.
Editor at run time - I can successfully check the logarithmic checkbox of a programmatically created LegendPalette and change the scale correctly. sbar.png (attached) is an example of what I'm trying to achieve.
Editor at design time - I can create the LegendPalette tool in the editor and configure it, but when it comes to saving the form after editing, I received the error:
Programmatically - I could not find a programmatic way of accessing the LegendPalette axis controls.
Hope it can be sorted out sometime, thanks,
Michael
Editor at run time - I can successfully check the logarithmic checkbox of a programmatically created LegendPalette and change the scale correctly. sbar.png (attached) is an example of what I'm trying to achieve.
Editor at design time - I can create the LegendPalette tool in the editor and configure it, but when it comes to saving the form after editing, I received the error:
The only way to prevent that error is to delete the tool.'Type 'System.ComponentModel.Component' in Assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b7a5c561934e089' is not marked as serializable.'
Programmatically - I could not find a programmatic way of accessing the LegendPalette axis controls.
Hope it can be sorted out sometime, thanks,
Michael
- Attachments
-
- sbar.png (67.51 KiB) Viewed 9426 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Logarithmic scaling using Legend Palette?
Hi Michael,
but it doesn't work either so I have added this issue (TF02016281) to the list too.
I could reproduce the issue here and added it (TF02016280) to the bug list to be fixed.Editor at design time - I can create the LegendPalette tool in the editor and configure it, but when it comes to saving the form after editing, I received the error:
'Type 'System.ComponentModel.Component' in Assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b7a5c561934e089' is not marked as serializable.'
I think you should be able to use something like:Programmatically - I could not find a programmatic way of accessing the LegendPalette axis controls.
Code: Select all
legendPalette1.GetVertAxis.AxisPen.Color = Color.Red;
Best Regards,
Narcís Calvet / 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 |
-
- Newbie
- Posts: 12
- Joined: Mon Feb 06, 2012 12:00 am
Re: Logarithmic scaling using Legend Palette?
Hi Narcis,
As I understand it, GetVertAxis returns the chart vertical axis, as opposed to the LegendPalette vertical axis. If I'm correct, it needs another way to access the LegendPalette axes. If you are correct, then the documentation is a little misleading.
Regards,
Michael
As I understand it, GetVertAxis returns the chart vertical axis, as opposed to the LegendPalette vertical axis. If I'm correct, it needs another way to access the LegendPalette axes. If you are correct, then the documentation is a little misleading.
Regards,
Michael
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Logarithmic scaling using Legend Palette?
Hi Michael,
As you may have seen in the chart editor already, LegendPalette tool is a chart itself. That's why I'd expect GetVertAxis to work also. Anyway, TF02016281 asks for a way to be able to access the axes programmatically.
As you may have seen in the chart editor already, LegendPalette tool is a chart itself. That's why I'd expect GetVertAxis to work also. Anyway, TF02016281 asks for a way to be able to access the axes programmatically.
Best Regards,
Narcís Calvet / 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 |