TChart: Autosizing Left and Right Axis - What's the trick? lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- Zitt · 2019-02-28 03:58 All, Appreciate the feedback received in my previous GUI advice thread. I went with some of the advice; using TA3nalogGauge as the basis for the start of my GUI. I tried modifying the behavior of TA3nalogGauge to include a min and max needle; but I couldn't get it to work right. I've added a Lazarus TChart to the GUI so I can give a chart representation of the current being utilized during the various "phases" of the RGB sequence. There are 5 configurable LED "strings" on this product; each can be configured with their own color/flashing sequence. The Chart currently needs to display two Axis... one on the Left which shows the individual currents and one on the right which displays the total current for the entire device. I've tried in vain using the following article: http://wiki.freepascal.org/TAChart_Tutorial:_Dual_y_axis,_Legend but I can't seem to get the autoscale to work properly. As you can see in the picture attached; the right axis will not auto-scale correctly. I pretty sure the values never exceed 1600mA... so there is no reason for the autoscale to factor up to 32000mA. What I need/what is for the Left and Right Axis to scale independently so both "waveforms" display at full scale. Thoughts? 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   object CurrentChart: TChart    AnchorSideLeft.Control = CurrentGauge    AnchorSideLeft.Side = asrBottom    AnchorSideTop.Control = CurrentGauge    AnchorSideRight.Control = FlashGB    AnchorSideRight.Side = asrBottom    AnchorSideBottom.Control = Owner  AnchorSideBottom.Side = asrBottom    Left = 209    Height = 231    Top = 496    Width = 367    AxisList = <          item        Grid.Color = clBtnShadow        TickColor = clBtnFace        Marks.LabelBrush.Style = bsClear        Minors = <>        Range.Max = 1        Range.UseMin = True        Title.LabelFont.Orientation = 900        Title.LabelBrush.Style = bsClear        Transformations = LeftAxisTransformations      end          item        Grid.Color = clBtnShadow        TickColor = clBtnFace        Alignment = calBottom        Marks.LabelBrush.Style = bsClear        Minors = <>        Range.Max = 40        Range.UseMax = True        Range.UseMin = True      Title.LabelBrush.Style = bsClear      end          item        Alignment = calRight        Group = 1        Marks.LabelBrush.Style = bsClear        Minors = <>        Range.Max = 1        Range.UseMin = True        Title.LabelBrush.Style = bsClear        Transformations = RightAxisTransformations      end>    BackColor = clBlack    Foot.Brush.Color = clBtnFace    Foot.Font.Color = clBlue    Frame.Color = clBtnFace    Legend.Alignment = laBottomCenter    Legend.ColumnCount = 5    Legend.Transparency = 50    Legend.Visible = True    Title.Brush.Color = clBtnFace    Title.Font.Color = clBlue    Title.Text.Strings = (      'TAChart'    )           object LeftAxisTransformations: TChartAxisTransformations    left = 248    top = 512    object LeftAxisTransform: TAutoScaleAxisTransform    end  end  object RightAxisTransformations: TChartAxisTransformations    left = 512    top = 512    object RightAxisTransform: TAutoScaleAxisTransform    end  end ---------------------------------------------------------------------- wp · 2019-02-28 09:25 You do not show the series in the lfm, but I speculate that you did not assign the series' AxisIndexY to the index of the left/right axis. ---------------------------------------------------------------------- Zitt · 2019-02-28 22:51 I'm about 80% sure I did assign both axis. I'll look again when I get home from the day job. Actually; I just noticed there was a TAChart subforum under "graphics"... http://forum.lazarus.freepascal.org/index.php/board,55.0.html Can a Mod move this topic there? ---------------------------------------------------------------------- wp · 2019-02-28 23:08 Quote from: Zitt on February 28, 2019, 11:51:24 pmI'm about 80% sure I did assign both axis.If you did you should extract the chart part of your project with some dummy data into a simple compilable demo which you can upload here via "Attachments and other options". Put .pas, .lfm, .lpr and .lpi files into a common zip, no compiler generated files (.exe, .ppu, .compiled etc) please. ---------------------------------------------------------------------- Zitt · 2019-03-03 06:06 Indeed; I am setting axis at runtime (as is all the data). A demo project is a little more complicated give the fact that all of the data is read runtime. Let me ponder this. ---------------------------------------------------------------------- wp · 2019-03-03 09:29 Please search the forum. I am rather sure that I already posted a runtime dual-axis example.