Charts use point indices for XValues

It seems that report charts use data point indices instead of the dataset values for the XValues of the chart. The dataset values are stored only as labels.

For example, if you chart the following data:

1 100
10 150
11 200

You get a chart like so:

1 100 (labeled "1")
2 150 (labeled "10")
3 200 (labeled "11")

In other words, I expect the second point to be 9 units away on the X axis from the first point, but it is shown only 1 unit away.

Under these conditions, (1) only linear data (evenly spaced points) can be charted and (2) you cannot overlay two data streams unless the number of points and the spacing is identical.

Am I simply missing an option somewhere?

Comments

  • edited 3:20PM
    Note, the following change to the source resolves this problem:

    in:
    procedure TfrxSeriesItem.FillSeries(Series: TChartSeries);
    
    changing:
    for i := 0 to slx.Count - 1 do
      if frxIsValidFloat(sly[i]) then
        Series.Add(frxStrToFloat(sly[i]), slx[i], clTeeColor);
    
    to:
    for i := 0 to slx.Count - 1 do
      if frxIsValidFloat(sly[i]) then
        if frxIsValidFloat(slx[i]) then
          Series.AddXY(frxStrToFloat(slx[i]), frxStrToFloat(sly[i]), slx[i], clTeeColor)
        else
          Series.Add(frxStrToFloat(sly[i]), slx[i], clTeeColor);
    
    Allows XValues to be used by the TChart axis mechanisms.

    Note: I didn't test it with all possible series types. If there is a problem, there might need to be an option for using AddXY vs Add.

    Is there a process for submitting proposed code changes to the developers?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.