Drawing series without Y axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Drawing series without Y axis

Post by GoToXY » Thu Mar 24, 2011 9:19 pm

I would like to know if there is a way to draw series without an Y series. That series should be align with the pixel of the chartrect or a ratio of it.

Why i need something like that:
We use TChart to analyse Data we collected from Build Automation System. Usually, the X(bottom) axis is the time, the Y(Left) axis is the (kW,kWh,m³,l/h, etc...) and the Y(right) axis is the °C or °F for outdoor/indoor temp et... Often, we have other series that are On/Off data. I want to be able to show those data in the same graphic. My idea was to show the first one on the bottom using 10 pixel height and the next one over that one. So those one are pixel related and wont be screwed by the Y axis zoom and scale.

What i did try to do is:
Using a TList to put all my On/Off series in and removing them from the TChart (so they wont be draw automatically)
Then, on the AfterDraw of the TChart, i am painting them manually.
This is "good" but im having some speed issue and when i did that, i forgot my code was all based on the TChart. So im screw because there are too much stuff to change to work with that TList of mine.

Is there an exceptional way to get where i wish to go ? I know that most of the time, you guys did already made stuff that i havent heared of. So please, do as usual, and tell me TChart already manage that and point me where to look at to solve my problem.

Thanks a lot.

GoToXY

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: Drawing series without Y axis

Post by GoToXY » Fri Mar 25, 2011 3:30 pm

Hi again

I though you may need more information. So there is a screeny of what i have done so far.
ss-lineseries-onoff.png
ScreenShot about the line series without Y axis
ss-lineseries-onoff.png (410.12 KiB) Viewed 8543 times
I did paint the background to be easier to see the 2 lineSeries.

As i told you before, im using the TChart.Series for a lots of stuff (Live Reports, Saving the graphics into my DB, showing a table of values, etc..)

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: Drawing series without Y axis

Post by GoToXY » Sat Mar 26, 2011 1:39 am

Oh well, im sorry to have bother you again. Sometimes, my brain just want to remake the world in its own way! :? Anyway, i just figure out that the only thing i had to do is to create a new kind of series from TSeriesLine and override the DrawValue fonction and then, add my code in it. So simple. I must need vacation lol.

Thanks to you to have make it simple as that to make custom series ect... I just finished it and it works like a charm!

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Drawing series without Y axis

Post by Yeray » Mon Mar 28, 2011 2:11 pm

Hello,

Another possibility you could try is to set:

Code: Select all

TChart1.Scroll.Enable = pmHorizontal
This restricts the whole chart to scroll horizontally. So the upper part won't scroll vertically.
However, you could use a chart for the upper part and another chart, or a subcharttool, for the down part. Something as in the example here:
http://www.teechart.net/support/viewtop ... 815#p45475
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: Drawing series without Y axis

Post by GoToXY » Tue Mar 29, 2011 12:50 pm

I need the scrolling option for the other series. Only the On/Off series must be unable to be scrolled by the Y axis. But thanks anyway for the idea.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Drawing series without Y axis

Post by Narcís » Fri Apr 01, 2011 10:17 am

Hi GoToXY,

In that case 2 charts or a subchart tool would be the way to go, as Yeray suggested. You could then restrict scrolling to horizontal for the chart you need.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply