Solved

How do I programmatically change the size of points on a point chart ?

Posted on 2014-10-16
12
272 Views
Last Modified: 2014-10-31
Hi,
I am programmatically adding points to a point series of a TChart. I want to be able to change the size of the points at run time so that if I zoom in too much I can still see them. It seems it is the density of points that makes them easy to see with the chart zoomed out. When I zoom in so much that only a few points are showing, they become impossible to see. They are a good size to see well until I zoom in too much. I was thinking of adding a spin button to allow manual resizing of the points when necessary. I think, but am not sure, that what I need to change is the width and height under "Small Dot" in the format tab of chart1.series1. I don't know how to do it programmatically. Something like TChart1.Series1.Format.width :=    ?
0
Comment
Question by:ChLa
  • 11
12 Comments
 
LVL 19

Expert Comment

by:Thommy
ID: 40386048
Try calling TChart.Draw() in your chart's OnZoom and OnUndoZoom event...

procedure TForm1.Chart1Zoom(Sender: TObject);
begin
  Chart1.Draw();
end;

procedure TForm1.Chart1UndoZoom(Sender: TObject);
begin
  Chart1.Draw();
end;

Open in new window

0
 

Author Comment

by:ChLa
ID: 40388958
This doesn't seem to help. When zoomed in the grid is easier to see than my plotted points.
0
 

Author Comment

by:ChLa
ID: 40389003
In this first picture you see a typical plot on the chart. This is the small version of the chart, with no zoom. You can see the plot is easy to see.
0
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

Author Comment

by:ChLa
ID: 40389007
In this second picture you see the small chart. Here I have zoomed in quite a bit and the plot is still easy to see.
ChartSmZm.jpg
0
 

Author Comment

by:ChLa
ID: 40389013
Here is that first picture.
ChartSmUnzm.jpg
0
 

Author Comment

by:ChLa
ID: 40389020
In this third picture we are still looking at the small chart. Here we have zoomed in quite a bit and now the plot is harder to see than the grid.
ChartSmZmmm.jpg
0
 

Author Comment

by:ChLa
ID: 40389029
In this fourth picture you see the large chart. I have a page control. To see the large chart I switch tabs (right click on the chart) to a larger free area where I move and resize the chart. Here I have already zoomed in as much as the second image and already it is a bit hard to see the plotted points.
ChartLgZm.jpg
0
 

Author Comment

by:ChLa
ID: 40389037
In this fifth and last image we are looking at the larger chart. We have zoomed in as much as in the third picture. You can see it is very difficult to see the plotted points. When I tried adding Chart1.Draw(); to the two events, it didn't effect the visibility of these plotted points.
ChartLgZmmm.jpg
0
 

Author Comment

by:ChLa
ID: 40389070
Okay, I lied, sorry...One more picture...
This image shows my current series settings for the chart.
SeriesSettings.jpg
0
 

Author Comment

by:ChLa
ID: 40392418
I have done some experimenting. I found that the horizontal and vertical sizes do not affect the size of Small Dots. It does change the size of circles. But while the small dots are colored individually, all circles appear in the same color, black. So what I am thinking is I need to be able to programmatically change from small dots to circles, and then back again.
I have been using AddXY like this: Chart1.Series[0].AddXY(X, Y, ' ', clBlue); so I can have the dots colored. Why don't the circles color ? How do I programmatically change from small dots to circles ?
If I change from small dots to circles after the chart is drawn, will the dots change to circles, or will I need to redraw the chart ?
0
 

Accepted Solution

by:
ChLa earned 0 total points
ID: 40405116
Never mind. I eventually found the answers myself. The circles did not appear to be colored because of a black border. Many closely spaced circles will appear black because of the border. I fixed this by making The border invisible. To change from small dots to circles: Series1.Pointer.Style:= paCircle; Of course Series1.Pointer.Style := SmallDot; changes it back. To change the size of circles: Series1.Pointer.Size := CircleSize; CircleSize is an integer.
0
 

Author Closing Comment

by:ChLa
ID: 40415298
I only received one comment to my question and it didn't work. I eventually discovered the answers myself.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question