~ubuntu-dev/gnucash/ubuntu

« back to all changes in this revision

Viewing changes to src/report/standard-reports/net-barchart.scm

  • Committer: Reinhard Tartler
  • Date: 2008-08-03 07:38:54 UTC
  • mfrom: (2.1.2 debian)
  • Revision ID: siretart@tauware.de-20080803073854-23i4uqi1e73no4oz
mergeĀ fromĀ debian/unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
          (N_ "Show a Net Worth bar?")) 
121
121
      #t))
122
122
 
 
123
    (add-option
 
124
     (gnc:make-simple-boolean-option
 
125
      gnc:pagename-display
 
126
      (N_ "Show table")
 
127
      "c" (N_ "Display a table of the selected data.")
 
128
      #f))
 
129
 
123
130
    (gnc:options-add-plot-size! 
124
131
     options gnc:pagename-display 
125
 
     optname-plot-width optname-plot-height "c" 500 400)
 
132
     optname-plot-width optname-plot-height "d" 500 400)
126
133
 
127
134
    (gnc:options-set-default-section options gnc:pagename-general)
128
135
 
179
186
         (report-title (get-option gnc:pagename-general 
180
187
                                  gnc:optname-reportname))
181
188
         (classified-accounts (gnc:decompose-accountlist accounts))
 
189
         (show-table? (get-option gnc:pagename-display (N_ "Show table")))
182
190
         (document (gnc:make-html-document))
183
191
         (chart (gnc:make-html-barchart))
184
192
         (non-zeros #f))
356
364
       
357
365
       ;; Test for all-zero data here.
358
366
       (if non-zeros
 
367
           (begin
359
368
           (gnc:html-document-add-object! document chart) 
 
369
             (if show-table?
 
370
             (let ((table (gnc:make-html-table)))
 
371
                (gnc:html-table-set-col-headers!
 
372
                 table
 
373
                 (append
 
374
                  (list (_ "Date"))
 
375
                  (if show-sep?
 
376
                      (if inc-exp?
 
377
                          (list (_ "Income") (_ "Expense"))
 
378
                          (list (_ "Assets") (_ "Liabilities")))
 
379
                      '())
 
380
                  (if show-net?
 
381
                      (if inc-exp?
 
382
                          (list (_ "Net Profit"))
 
383
                          (list (_ "Net Worth")))
 
384
                      '()))
 
385
                 )
 
386
               (gnc:html-table-append-column! table date-string-list)
 
387
               (if show-sep?
 
388
                   (begin
 
389
                     (gnc:html-table-append-column! table assets-list)
 
390
                     (gnc:html-table-append-column! table liability-list)
 
391
                    )
 
392
                   )
 
393
               (if show-net?
 
394
                   (gnc:html-table-append-column! table net-list)
 
395
                   )
 
396
               ;; set numeric columns to align right
 
397
                (for-each
 
398
                 (lambda (col)
 
399
                   (gnc:html-table-set-col-style!
 
400
                    table col "td"
 
401
                    'attribute (list "align" "right")))
 
402
                 '(1 2 3))
 
403
 
 
404
              (gnc:html-document-add-object! document table))
 
405
             ))
360
406
           (gnc:html-document-add-object!
361
407
            document
362
408
            (gnc:html-make-empty-data-warning