tktax_histogram/
create_account_histogram.rs

1// ---------------- [ File: tktax-histogram/src/create_account_histogram.rs ]
2crate::ix!();
3
4pub trait CreateAccountHistogram {
5
6    fn histogram(&self, strategy: &HistogramDisplayStrategy) -> AccountHistogram;
7}
8
9impl CreateAccountHistogram for Account {
10
11    fn histogram(&self, strategy: &HistogramDisplayStrategy) -> AccountHistogram {
12
13        let bins = convert_vec_f64_to_vec_decimal(
14                &vec![
15                -10000.0, 
16                -2000.0, 
17                -1000.0, 
18                -500.0, 
19                -200.0, 
20                -100.0, 
21                -60.0, 
22                -20.0, 
23                0.0, 
24                20.0, 
25                60.0, 
26                100.0, 
27                200.0, 
28                500.0, 
29                1000.0, 
30                2000.0, 
31                10000.0
32                ]
33            );
34
35        AccountHistogramBuilder::new(self, bins).build_histogram(strategy)
36    }
37}