Recent

Author Topic: TAGraph - custom marking  (Read 10118 times)

Furby

  • New member
  • *
  • Posts: 8
TAGraph - custom marking
« on: February 10, 2011, 02:39:21 pm »
I use TAGraph package in my project and I want X axis to show values as time.. in format HH:MM:SS, this is all good I've done it with Bottom.Marks.Source and used there TListChartSource.. and generated times from integers, altough it shows all the time all the numbers it can show, which looks pretty ugly because numbers go next to each other and are unreadable also the grid is so thick that it looks like there are horizontal lines, this is how it looks with integers:

Normal values

and this is how it looks with time format now:

Time format

how I would want it: Desired result

I'd want the time format to looks same as the integer format, for example to show one vertical line in grid for every half an hour or so..

Thanks in advance for your help!
« Last Edit: February 10, 2011, 04:23:04 pm by Furby »

faber

  • Guest
Re: TAGraph - custom marking
« Reply #1 on: February 10, 2011, 03:31:30 pm »
If you add data in this way:
ListChartSource.dataPoints.Add(varX+'|'+varY+'|'+Color+'|'+LabX)
you can use LabX as own labels.

Furby

  • New member
  • *
  • Posts: 8
Re: TAGraph - custom marking
« Reply #2 on: February 10, 2011, 04:11:48 pm »
Apparently you didn't read my whole post, I've already done that. It just tries to show all values at once and grid is too thick.

This is how I want it to look(made in paint):

Pic
« Last Edit: February 10, 2011, 04:21:39 pm by Furby »

Furby

  • New member
  • *
  • Posts: 8
Re: TAGraph - custom marking
« Reply #3 on: February 12, 2011, 03:27:11 pm »
bump

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: TAGraph - custom marking
« Reply #4 on: February 25, 2011, 05:39:49 am »
Sorry for late answer -- I did not notice your post.
In the future, you might get faster response by using mailing list instead of forum.

There are several options available:
1) Set Axis.Marks.OverlapPolicy = opHideHeighbour
2) Use a separate ListSource for marks -- it does not have to be the same as series data source
3) If your X values are TDateTime-compatible, use TDateTimeIntervalChartSource

Furby

  • New member
  • *
  • Posts: 8
Re: TAGraph - custom marking
« Reply #5 on: March 23, 2011, 05:58:54 pm »
Okay, thanks for the answer.

I'm still working on this project, so no problem for late answer, better than none at all. :)

Now I kinda don't need the time values there, I need my chart to be split with 12 vertical lines and at bottom axis show values (marks) of positions of those values, this is all easy I can do that easily with second option you suggested, I just calculate position of 1/12, 2/12.. of my chart and make new chart source and put it there.

Although, problem is with the zooming, when I zoom there will be no more smaller verticals, only those 12 verticals I made. So I thought of solution, every time I click on chart it checks if it is zoomed in and if it is it will abandon those 12 vertical lines and put there the normal classic ones. However there is no option like IsChartZoomed. There is only boolean FIsZoomed which is protected. Is there other way to check if the chart is zoomed in?

Thanks for answer in advance.

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: TAGraph - custom marking
« Reply #6 on: March 23, 2011, 07:21:21 pm »
The fact that the chart is zoomed is not as important as the zoom factor.
I'd recommend you to check LogicalExtent property and switch your axis source
when it becomes smaller then some threshold.

Also note that you can add two bottom axises, one with default source and one
with your custom source, and display only one of them
(or both, for some intermediate values) depending on the current extent.


 

TinyPortal © 2005-2018