Odd X-axis |
Post Reply ![]() |
Author | |
Hennekens Stephan ![]() New Member ![]() Joined: 16 Aug 2012 Posts: 24 |
![]() ![]() ![]() ![]() Posted: 11 Jul 2018 at 10:17am |
I have a chart with two series of XY-markers. The X-axis looks odd. I would like to have numbers like 10, 20, 30 etc on the axis and not values in between. Also there is a second row with values that don;t make any sense at all. The max value on the X-axis is 100. Code is listed below the chart. ![]() Chart.BeginUpdate; with Chart.Panes[0] do begin Series.Clear; Title.Font.Color := clBlue; Title.Font.Style := [fsBold]; Range.RangeFrom := 0; Range.RangeTo := 100; Title.Text := ''; XAxis.AutoSize := False; YAxis.AutoSize := False; end; // first serie with Chart.Panes[0].Series.Add do begin ClearPoints; Color := Lighter(clBlue, 50); LegendText := 'Trouwgraad op basis van presentie'; ChartType := ctXYMarkers; ShowValue := False; AutoRange := arDisabled; Maximum := 100; Minimum := 0; Marker.MarkerType := mCircle; Marker.MarkerSize := 10; Marker.MarkerColor := clBlue; Marker.MarkerColorTo := Lighter(clBlue, 50); Marker.MarkerLineColor := clGreen; Marker.GradientType := gtForwardDiagonal; Marker.OpacityTo := 150; Marker.SelectedColor := clBlue; Marker.SelectedColorTo := Lighter(clBlue, 50); Marker.SelectedLineColor := clBlue; Marker.SelectedSize := 10; LineColor := Lighter(clGreen, 50); LineWidth := 0; XAxis.MajorUnit := 10; end; // second serie with Chart.Panes[0].Series.Add do begin ClearPoints; Color := RGB(128, 176, 255); Color := Lighter(clGreen, 50); LegendText := 'Trouwgraad op basis van gemiddelde bedekking'; ChartType := ctXYMarkers; ShowValue := False; AutoRange := arDisabled; Maximum := 100; Minimum := 0; Marker.MarkerType := mCircle; Marker.MarkerSize := 10; Marker.MarkerColor := clGreen; Marker.MarkerColorTo := Lighter(clGreen, 50); Marker.MarkerLineColor := clGreen; Marker.GradientType := gtForwardDiagonal; Marker.OpacityTo := 150; Marker.SelectedColor := clGreen; Marker.SelectedColorTo := Lighter(clGreen, 50); Marker.SelectedLineColor := clGreen; Marker.SelectedSize := 10; LineColor := Lighter(clGreen, 50); LineWidth := 0; end; syntaxon := cmxPlantengemeenschappen.Value; syntaxonnaam := cmxPlantengemeenschappen.Text; n := Pos(' - ', syntaxonnaam); syntaxonnaam := Copy(syntaxonnaam, n + 3, Length(syntaxonnaam) - 2 - n); points := TObjectList.Create; try formMain.DbLocal.GetplantengemeenschappenFingerprint(points, syntaxon); Chart.Panes[0].Title.Text := GetLangStr('Vingerafdruk') + ' ''' + syntaxonnaam + ''' (' + IntToStr(points.Count) + ' ' + GetLangStr('SoortenMetPresentie>0.1') + ')'; SetLength(FSepciesnames, points.Count); for i := 0 to points.Count - 1 do begin point := TFingerprintPoint(points); Chart.Panes[0].Series[0].AddSingleXYPoint(point.Constancy, point.FaithfulnessPres); Chart.Panes[0].Series[1].AddSingleXYPoint(point.Constancy, point.FaithfulnessCover); FSepciesnames := point.Speciesname; // + Format(' %.f1 %.f1', [point.Constancy, point.FaithfulnessCover]); end; finally points.Free; end; Chart.EndUpdate; |
|
![]() |
|
Pieter Scheldeman ![]() TMS Support ![]() Joined: 18 May 2010 Posts: 3392 |
![]() ![]() ![]() ![]() |
Hi,
The secondary values are the XValues, please turn them off with XValues := False on Series X-Axis level. Additionally, the jumps between the values are caused by the MajorUnit and MinorUnit properties, you can set these also at Series X-Axis level. There is an option to turn off auto-calculation of units with the AutoUnits property.
|
|
![]() |
|
Hennekens Stephan ![]() New Member ![]() Joined: 16 Aug 2012 Posts: 24 |
![]() ![]() ![]() ![]() |
Bingo. Thanks a lot Pieter.
I have now moved all my charts from a certain package to AdvCharts. I am quite satisfied with the flexibility and aesthetic aspects of the package. Regards, Stephan |
|
![]() |
|
Pieter Scheldeman ![]() TMS Support ![]() Joined: 18 May 2010 Posts: 3392 |
![]() ![]() ![]() ![]() |
Thanks Stephan!
|
|
![]() |
Post Reply ![]() |
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |