TAChart lazarus / 39-Graphics ---------------------------------------------------------------------- MISV · 2018-08-20 12:21 I have this code porting from Delphi to Lazarus Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i       TmpSeries := nil;      if TmpSeries = nil then        begin          TmpSeries := TBarSeries.Create(FWebsiteMain_Edit_LR_Summary_Chart);        TmpSeries.Marks.Style := smsValue; // box above each bar{$IFDEF mymsDELPHI}          TmpSeries.XValues.DateTime := False;          TmpSeries.ParentChart := FWebsiteMain_Edit_LR_Summary_Chart;{$ENDIF}{$IFDEF mymsFPCDevTool}        FWebsiteMain_Edit_LR_Summary_Chart.AddSeries(TmpSeries);{$ENDIF}        end      ;      if Assigned(TmpSeries) then        begin        for J := Low(A) to High(A) do          begin{$IFDEF mymsFPCDevTool}           TmpSeries.AddY(A[J].Value, A[J].Key);{$ENDIF}{$IFDEF mymsDELPHI}            TmpSeries.AddY(A[J].Value, A[J].Key);{$ENDIF}        end;        end      ;  My problem is the xaxis on the chart... Instead of x-axis having a named label below each vertical bar (e.g. "students", "teachers" like my Delphi version has) the xaxis is instead filled with numbers: 0.65, 0.7, 0.75 (continuing full width of control) which I do not want. The chart itself is declared like this this Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     FWebsiteMain_Edit_LR_Summary_Chart: TChart;    {$IFDEF mymsFPCDevTool}    FWebsiteMain_Edit_LR_Summary_Chart_LinearAxisTransform: TLinearAxisTransform;    {$ENDIF}  and initialized like this Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   FWebsiteMain_Edit_LR_Summary_Chart := TChart.Create(pnlWebsiteMain_Edit_LR_Summary_Chart);  FWebsiteMain_Edit_LR_Summary_Chart.Parent := pnlWebsiteMain_Edit_LR_Summary_Chart;  FWebsiteMain_Edit_LR_Summary_Chart.Align := alClient;  FWebsiteMain_Edit_LR_Summary_Chart.Color := clWindow;  FWebsiteMain_Edit_LR_Summary_Chart.LeftAxis.Inverted := False;  FWebsiteMain_Edit_LR_Summary_Chart.LeftAxis.Logarithmic := False;{$IFDEF mymsDELPHI}  FWebsiteMain_Edit_LR_Summary_Chart.LeftAxis.Automatic := True;  FWebsiteMain_Edit_LR_Summary_Chart.DepthAxis.Automatic := False;  FWebsiteMain_Edit_LR_Summary_Chart.DepthAxis.AutomaticMaximum := False;  FWebsiteMain_Edit_LR_Summary_Chart.DepthAxis.AutomaticMinimum := False;  FWebsiteMain_Edit_LR_Summary_Chart.DepthAxis.Maximum := 0.5;  FWebsiteMain_Edit_LR_Summary_Chart.DepthAxis.Minimum := -0.5;  FWebsiteMain_Edit_LR_Summary_Chart.DepthTopAxis.Automatic := False;  FWebsiteMain_Edit_LR_Summary_Chart.DepthTopAxis.AutomaticMaximum := False;  FWebsiteMain_Edit_LR_Summary_Chart.DepthTopAxis.AutomaticMinimum := False;  FWebsiteMain_Edit_LR_Summary_Chart.DepthTopAxis.Maximum := 0.5;  FWebsiteMain_Edit_LR_Summary_Chart.DepthTopAxis.Minimum := -0.5;  FWebsiteMain_Edit_LR_Summary_Chart.RightAxis.Automatic := False;  FWebsiteMain_Edit_LR_Summary_Chart.BackWall.Brush.Color := clWhite;  FWebsiteMain_Edit_LR_Summary_Chart.BackWall.Brush.Style := bsClear;  FWebsiteMain_Edit_LR_Summary_Chart.Zoom.Allow := False;  FWebsiteMain_Edit_LR_Summary_Chart.Legend.LegendStyle := lsSeries;  FWebsiteMain_Edit_LR_Summary_Chart.View3D := False;{$ENDIF}  FWebsiteMain_Edit_LR_Summary_Chart.Foot.Text.Text := '';  FWebsiteMain_Edit_LR_Summary_Chart.Foot.Visible := False;{$IFDEF mymsFPCDevTool}  FWebsiteMain_Edit_LR_Summary_Chart_LinearAxisTransform := TLinearAxisTransform.Create(FWebsiteMain_Edit_LR_Summary_Chart);  if  (FWebsiteMain_Edit_LR_Summary_Chart.LeftAxis <> nil)  then    begin    FWebsiteMain_Edit_LR_Summary_Chart.LeftAxis.Transformations := TChartAxisTransformations.Create(nil);      if        (FWebsiteMain_Edit_LR_Summary_Chart.LeftAxis.Transformations <> nil)    then        begin          if            (FWebsiteMain_Edit_LR_Summary_Chart.LeftAxis.Transformations.List <> nil)          then            begin              FWebsiteMain_Edit_LR_ Summary_Chart.LeftAxis.Transformations.List.Add(FWebsiteMain_Edit_LR_S ummary_Chart_LinearAxisTransform);            end          ;        end      ;    end  ;  FWebsiteMain_Edit_LR_Summary_Chart.Legend.Alignment := laBottomCenter;{$ENDIF}{$IFDEF mymsDELPHI}  FWebsiteMain_Edit_LR_Summary_Chart.Legend.Alignment := laBottom;{$ENDIF} ---------------------------------------------------------------------- wp · 2018-08-20 13:00 You must assign the Chartsource of the series to the ChartSource of the axis (Axis.Marks.Source) and the Axis.Marks.Style to smsLabel in order to show the series labels as axis labels. Since you add the data values directly to the series their ChartSource is accessible via the ListSource of the series. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   FWebsiteMain_Edit_LR_Summary_Chart.BottomAxis.Marks.Source := TmpSeries.ListSource;  FWebsiteMain_Edit_LR_Summary_Chart.BottomAxis.Marks.Style := smsLabel; You don't need to add a TLinearAxisTransform to have linear axis divisions. Please have a look at http://wiki.lazarus.freepascal.org/Comparing_TAC hart_with_Delphi%27s_TeeChart_Standard for a comparison between TAChart and TeeChart properties. ---------------------------------------------------------------------- MISV · 2018-08-20 22:32 Thank you very much - appears to solve my problem