diff --git a/components/fpspreadsheet/source/common/fpsopendocumentchart.pas b/components/fpspreadsheet/source/common/fpsopendocumentchart.pas index e01110935..d2c890858 100644 --- a/components/fpspreadsheet/source/common/fpsopendocumentchart.pas +++ b/components/fpspreadsheet/source/common/fpsopendocumentchart.pas @@ -976,7 +976,6 @@ begin FStockSeries.RangeLine.Color := scBlack; FStockSeries.CandleStickDownFill.Style := cfsSolid; FStockSeries.CandleStickDownFill.Color := scBlack; - break; end; end; end; @@ -1308,7 +1307,7 @@ var n: Integer; begin s := GetAttrValue(ANode, 'chart:class'); - if (FChartType = ctStock) then + if (FChartType = ctStock) and (s = '') then series := FStockSeries else case s of @@ -1346,6 +1345,9 @@ begin else ReadChartCellRange(ANode, 'chart:values-cell-range-address', series.YRange); + if series.XRange.IsEmpty then + series.XRange.Assign(series.Chart.XAxis.CategoryRange); + s := GetAttrValue(ANode, 'chart:attached-axis'); if s = 'primary-y' then series.YAxis := alPrimary diff --git a/components/fpspreadsheet/source/visual/fpspreadsheetchart.pas b/components/fpspreadsheet/source/visual/fpspreadsheetchart.pas index cd5a0f059..44d02f02f 100644 --- a/components/fpspreadsheet/source/visual/fpspreadsheetchart.pas +++ b/components/fpspreadsheet/source/visual/fpspreadsheetchart.pas @@ -1084,7 +1084,10 @@ begin case ASeries.ChartType of ctBar: - Result := TBarSeries.Create(FChart); + begin + Result := TBarSeries.Create(FChart); + src.IntegerX := true; + end; ctLine, ctScatter: Result := TLineSeries.Create(FChart); ctArea: @@ -1673,6 +1676,7 @@ procedure TsWorkbookChartLink.UpdateBarSeries(AWorkbookSeries: TsBarSeries; begin UpdateChartBrush(AWorkbookSeries.Chart, AWorkbookSeries.Fill, AChartSeries.BarBrush); UpdateChartPen(AWorkbookSeries.Chart, AWorkbookSeries.Line, AChartSeries.BarPen); + AChartSeries.BarWidthStyle := bwPercentMin; AChartSeries.Stacked := AWorkbookSeries.Chart.StackMode <> csmSideBySide; if AChartSeries.Source is TCalculatedChartSource then TCalculatedChartSource(AChartSeries.Source).Percentage := (AWorkbookSeries.Chart.StackMode = csmStackedPercentage);