Hi,
I want to draw an "emtpy" chart with the axes only.
You key in e.g. value 33 as lower value and 909 as upper value, - and TCharts draws a nice emtpy window from (in my case left axes) 33 to 909.
My problem is "empty window".
If I set the series to invisible, the annonation of the y-axes is will be gone as well.
If I set it to visible, the chart window is not empty any more, but the series is drawn.
Is there a style for my series which makes its drawing invisible and keeps the annonation at the axes?
I rather would prefer to see the y-axes only and x-axes empty as well.
And in my highest phantasies the grid above the not visible series is visible.
Thanks,
Cheryll
Series - show axes only = (not) "invisible" series
Re: Series - show axes only = (not) "invisible" series
Hi Cheryll,
Here the complete code of an example I just made to check it:
I'm drawing a rectangle with OnAfterDraw event to check the bottom axis has the correct minimum and maximum values. Because once you hide the labels, you loose that reference.
What about having a "dummy series"? It would be a series without any values. Ie:Chartist wrote:I want to draw an "emtpy" chart with the axes only.
You key in e.g. value 33 as lower value and 909 as upper value, - and TCharts draws a nice emtpy window from (in my case left axes) 33 to 909.
My problem is "empty window".
If I set the series to invisible, the annonation of the y-axes is will be gone as well.
If I set it to visible, the chart window is not empty any more, but the series is drawn.
Is there a style for my series which makes its drawing invisible and keeps the annonation at the axes?
Code: Select all
uses Series, TeCanvas;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
Chart1.AddSeries(TFastLineSeries);
Chart1.Axes.Left.SetMinMax(33,909);
Chart1.Axes.Bottom.SetMinMax(0,100);
end;
Have you tried hiding the bottom axis labels?Chartist wrote:I rather would prefer to see the y-axes only and x-axes empty as well.
And in my highest phantasies the grid above the not visible series is visible.
Code: Select all
Chart1.Axes.Bottom.Labels:=false;
Code: Select all
uses Series, TeCanvas;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
Chart1.AddSeries(TFastLineSeries);
Chart1.Axes.Left.SetMinMax(33,909);
Chart1.Axes.Bottom.SetMinMax(0,100);
Chart1.Axes.Bottom.Labels:=false;
end;
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var tmpLeft, tmpRight, tmpTop, tmpBottom: Integer;
begin
tmpLeft:=Chart1.Axes.Bottom.CalcPosValue(45);
tmpRight:=Chart1.Axes.Bottom.CalcPosValue(55);
tmpTop:=Chart1.Axes.Left.CalcPosValue(400);
tmpBottom:=Chart1.Axes.Left.CalcPosValue(500);
Chart1.Canvas.Brush.Style:=bsClear;
Chart1.Canvas.Rectangle(tmpLeft, tmpTop, tmpRight, tmpBottom);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Series - show axes only = (not) "invisible" series
Hi Yeray,
thank you so much for this genius and complete solution!
Warm Regards,
Cheryll
thank you so much for this genius and complete solution!
Warm Regards,
Cheryll
Cheryll
Re: Series - show axes only = (not) "invisible" series
Hi Cheryll,
You're welcome!Chartist wrote:thank you so much for this genius and complete solution!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |