Print Page | Close Window

Chart conversion ...

Printed From: TMS Software
Category: VCL Components
Forum Name: VCL Chart
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=8174
Printed Date: 06 Dec 2019 at 11:52am


Topic: Chart conversion ...
Posted By: Fare' Daniele
Subject: Chart conversion ...
Date Posted: 07 Sep 2017 at 6:30pm
Good afternoon to all,
i'm tring to convert the last non advchart in my project into TAdvGDIPChartView.
The first problem is that the chart is insert in very small area, and i can't move it.
The second problem is that the chart have 1 pane with 2 series, one fot current year and one for last year.
X axis is a "day line" and i need to display only the day number; Chart type does not rapresnt a problem.
All points are added with AddSinglePoint procedure.
The problem i have is how set the space from one day number and next.
This is a old chart (real dimension)



and this is the trial chart conversion .... (the secon serie is missing at the moment); i'm tring with bar ....



How is possible paint the string '1' in the middle of first bar??

The code i use to make test serie is

procedure TMF.ImpostaGrafico;
Var I : Integer;
begin
for I:=CHT1.Panes.Count - 1 downto 0 do
        CHT1.Panes.Free;

CHT1.BeginUpdate;
// Aggiungo un nuovo panel
CHT1.Panes.Add;
CHT1.Panes[0].Range.RangeFrom:=0;
CHT1.Panes[0].Range.RangeTo:=31;
CHT1.Panes[0].CrossHair.CrossHairType:=chtFullSizeCrossHairAtCursor;
CHT1.Panes[0].CrossHair.CrossHairYValues.ShowSerieValues:=True;
CHT1.Panes[0].CrossHair.CrossHairYValues.Position:= CHT1.Panes[0].CrossHair.CrossHairYValues.Position + [chAtCursor];
CHT1.Panes[0].CrossHair.Visible:=False;
CHT1.Panes[0].Legend.Visible:=False;
CHT1.Panes[0].AxisMode:=amAxisChartWidthHeight;
CHT1.Panes[0].XAxis.UnitType:=utDay;
CHT1.Panes[0].XAxis.AutoSize:=False;
CHT1.Panes[0].YAxis.AutoSize:=True;
CHT1.Panes[0].Title.Text:='Comparazione Mensile ';
CHT1.Panes[0].Title.Font.Color:=clNavy;
CHT1.Panes[0].Title.Font.Style:=[fsBold];
CHT1.Panes[0].Title.Position:=tTop;
CHT1.Panes[0].Title.Alignment:=taCenter;
// Aggiungo una nuova serie Anno Precedente
CHT1.Panes[0].Series.Add;
CHT1.Panes[0].Series.BarChartSpacing:=5;
//CHT1.Panes[0].Series.BarChartSpacingType:=wtPixels;
CHT1.Panes[0].Series[0].CrossHairYValue.Color:=clRed;
CHT1.Panes[0].Series[0].CrossHairYValue.Font.Color:=clYellow;
CHT1.Panes[0].Series[0].ShowValue:=True;
CHT1.Panes[0].Series[0].ValueAngle:=20;
CHT1.Panes[0].Series[0].ValueFormat:='#,###,##0.#0';
CHT1.Panes[0].Series[0].ValueFormatType:=vftFloat;
CHT1.Panes[0].Series[0].ValueFont.Color:=clMaroon;
CHT1.Panes[0].Series[0].ChartType:=ctBar;
CHT1.Panes[0].Series[0].AutoRange:=arCommonZeroBased;
CHT1.Panes[0].Series[0].RangePercentMargin := 15;
CHT1.Panes[0].Series[0].XAxis.XYValues:=False;
CHT1.Panes[0].Series[0].YAxis.AutoUnits:=True;

// CHT1.Panes[0].Series[0].Enable3D:=True;
CHT1.Panes[0].Series[0].Minimum:=0;
CHT1.Panes[0].Series[0].Maximum:=120000;
CHT1.Panes[0].Series[0].AddSinglePoint(3945.25,Date,clRed,True,'1');
CHT1.Panes[0].Series[0].AddSinglePoint(2690.49,Date,clRed,True,'2');

CHT1.EndUpdate;
end;

Thank's for your help

Regard

Daniele




Replies:
Posted By: Pieter Scheldeman
Date Posted: 08 Sep 2017 at 9:00am
Hi, 

Please send us your sample and step-by-step instructions on how to reproduce those issues with a short description on the issues. It's unclear now exactly which issues you are facing.


Posted By: Fare' Daniele
Date Posted: 08 Sep 2017 at 11:47am
Hi Pieter,
thank's for your reply.
As first step i need to reproduce this


"This" meaning two series with different X value (grpouping as well to be used as "label") showed on two lines ....

but i'm not able ... sorry ...

Thank's for any help you can give me !!!

Regard

Daniele




Posted By: Pieter Scheldeman
Date Posted: 11 Sep 2017 at 8:33am
you can disable the X-Axis for each series with Series[0].XAxis.Visible := False;


Posted By: Fare' Daniele
Date Posted: 11 Sep 2017 at 12:45pm
Hi Pieter,
yes with Series[0].XAxis.Visible := False; i can show or not the serie's x axis ....
But i found this (simple code)

CHT1.BeginUpdate;
// Aggiungo un nuovo pane
CHT1.Panes.Add;
CHT1.Panes[0].XAxis.UnitType:=utDay;
CHT1.Panes[0].Range.RangeFrom:=0;
CHT1.Panes[0].Range.RangeTo:=30;

// CHT1.Panes[0].XAxis.AutoSize:=False; << -- UNCOMMENT
// Just to draw a bar on chart
CHT1.Panes[0].Series[0].Minimum:=0;
CHT1.Panes[0].Series[0].Maximum:=120000;
CHT1.Panes[0].Series[0].ChartType:=ctBar;
CHT1.Panes[0].Series[0].AddSinglePoint(3945.25,Date,clRed,True,'1');

// Aggiungo una serie
CHT1.Panes[0].Series.Add;

// Aggiungo una serie
CHT1.Panes[0].Series.Add;

// Aggiorno il grafico
CHT1.EndUpdate;

With this code a blank chart is drowed with 2 series and 2 x axisis, all with default setting.
Now if run the same code but with signed line uncomment, the second x axis will be hide.
Why?? I need more then 1 x axis with no autosize.

So i leave CHT1.Panes[0].XAxis.AutoSize:=True and
     CHT1.Panes[0].Series[0].XAxis.AutoUnits:=False;

In this case all 31 x point are drowed on x axis with it's own value; like



but i need the second x axis blank and the first one with only 1 value (under the bar)

Thank's for reply

Regard

Daniele




Posted By: Pieter Scheldeman
Date Posted: 11 Sep 2017 at 1:46pm
Hi, 

Can you please send us your sample so we can investigate which properties are set and which are missing? So we can help you out as soon as possible.


Posted By: Pieter Scheldeman
Date Posted: 13 Sep 2017 at 9:12am
Hi, 

We have investigated your sample and unfortunately bar charts combined with date-time x-Axis is not supported. You can take a look at the supported chart-types in the following sample:

http://www.tmssoftware.com/site/advchart.asp?s=faq&show=293 - http://www.tmssoftware.com/site/advchart.asp?s=faq&show=293

Alternatively you can take a look at the TMS FNC Chart ( http://www.tmssoftware.com/site/tmsfncchart.asp - http://www.tmssoftware.com/site/tmsfncchart.asp ) which has been built from the ground up and supports date-time X-Axis for all chart-types that are included.



Print Page | Close Window