プロジェクト

全般

プロフィール

Vote #75912

未完了

wrong bar length in PDF gantt chart

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Gantt_34
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
34
version_id:
0
issue_org_id:
18792
author_id:
118717
assigned_to_id:
0
comments:
0
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

In my pdf gantt chart, some task bars which have small progress percentage are painted with wrong length.
They must have short green rectangle, but the results is long green rectangle.

In lib/redmine/helpers/gantt.rb, the green rectangle is painted here:

if coords[:bar_progress_end]
  params[:pdf].SetY(params[:top] + 1.5)
  params[:pdf].SetX(params[:subject_width] + coords[:bar_start])
  params[:pdf].SetFillColor(90, 200, 90)
  params[:pdf].RDMCell(coords[:bar_progress_end] - coords[:bar_start], height, "", 0, 0, "", 1)
end

If a task have small progress, @coords[:bar_progress_end]@ and @coords[:bar_start]@ may have the same value because they are rounded by this code.

# Transforms dates into pixels witdh
coords.keys.each do |key|
  coords[key] = (coords[key] * zoom).floor
end

If @coords[:bar_progress_end] - coords[:bar_start]@ was zero, RDMCell() paints long rectangle stretched to the most right side.

Environment:
Redmine version 2.5.2.stable
Ruby version 1.9.3-p484 (2013-11-22) [x86_64-linux]
Rails version 3.2.19
Environment production
Database adapter Mysql2

Admin Redmine さんが約4年前に更新

  • カテゴリGantt_34 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0