hi
Is there any way to display axis without assigning a visible series
I need to draw multiple vertical axis, the axis should be displayed regardless of whether there is a visible series associated with it.
I've tried using OnAfterDraw events and then calling Axis->CustomDraw
however this does not work as it only draws the Axis line not the labels, ticks or title if there is no visible series.
adding a dummy series to the custom axis doesn't work because it shows in the legend even though its show in legend property is false.
Using TeeChart Pro v7.12 Win32. C++ Personality in RAD Studio 2007 with Dec2007 update + June hotfix
Draw Axis without a series:?:
Hi Scott,
Here is how you could do it. The axes need a series associated to them to be displayed but the series doesn't need to have any value because you can use SetMinMax method.
Note that you can remove the series from the legend with ShowInLegend property. And also note that this code is in delphi, but you shouldn't find too much problems converting it to c++.
Here is how you could do it. The axes need a series associated to them to be displayed but the series doesn't need to have any value because you can use SetMinMax method.
Note that you can remove the series from the legend with ShowInLegend property. And also note that this code is in delphi, but you shouldn't find too much problems converting it to c++.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1.AddSeries(TPointSeries.Create(self));
Chart1.AddSeries(TPointSeries.Create(self));
Chart1.CustomAxes.Add;
Chart1[1].CustomVertAxis := Chart1.CustomAxes.Items[0];
for i:=0 to Chart1.SeriesCount-1 do
begin
Chart1[i].Clear;
Chart1[i].ShowInLegend:=false;
end;
Chart1.View3D := false;
Chart1.MarginLeft := 5;
Chart1.Axes.Left.SetMinMax(0,100);
Chart1.Axes.Bottom.SetMinMax(0,100);
Chart1.CustomAxes.Items[0].SetMinMax(200, 300);
Chart1.CustomAxes.Items[0].PositionUnits:=muPixels;
Chart1.CustomAxes.Items[0].PositionPercent:=-30;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
drawing an axis without assigning a series
Hi Yeray
thanks for your response.
problem is that the series still shows up in the TChartListBox,
I've already used the technique you described. i.e assign an empty series.
I need to be able to add several additional axes without having a how bunch of empty series show up in the TChartListBox.
I've tried using CustomAxisDraw but it doesn't draw the axis labels if no series is assigned. even if I set the min max values.
Is there a solution for this
thanks for your response.
problem is that the series still shows up in the TChartListBox,
I've already used the technique you described. i.e assign an empty series.
I need to be able to add several additional axes without having a how bunch of empty series show up in the TChartListBox.
I've tried using CustomAxisDraw but it doesn't draw the axis labels if no series is assigned. even if I set the min max values.
Is there a solution for this
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Scott,
I'm afraid this is not possible.problem is that the series still shows up in the TChartListBox,
I've already used the technique you described. i.e assign an empty series.
I need to be able to add several additional axes without having a how bunch of empty series show up in the TChartListBox.
You could try using custom labels as shown in the All Features\Welcome!\Axes\Labels\Custom labels example at the new featuers demo, available at TeeChart's program group.I've tried using CustomAxisDraw but it doesn't draw the axis labels if no series is assigned. even if I set the min max values.
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 |