潘蓝兰

名称

SimpleR::Reshape::ChartData

说明

将统计数据转换为画图数据,让SimpleCall::ChartDirector调用

函数

实例参考 xt子文件夹

read_chart_data_dim2

   my ($r, %opt) = read_chart_data_dim2('01.dim2.csv', 
        skip_head=> 1, 
        label => [0], 
        data => [1], 
        sep=> ','
    );
  #$r = [4, 3, 5],
  #%opt = ("legend", [
    #"\xE6\x9D\x8E\xE5\xAD\x90",
    #"\xE6\xA1\x83\xE5\xAD\x90",
    #"\xE8\x8B\xB9\xE6\x9E\x9C", ],
  #"label", [
    #"\xE6\x9D\x8E\xE5\xAD\x90",
    #"\xE6\xA1\x83\xE5\xAD\x90",
    #"\xE8\x8B\xB9\xE6\x9E\x9C", ], )
  

read_chart_data_dim3

    my ($r, %opt) = read_chart_data_dim3('02.dim3.csv', 
        skip_head=> 1, 
        label => [0], 
        legend => [1], 
        data => [2], 
        sep=> ',', 
        charset => 'utf8', 
    );
    #$r = [[3, 2], [0, 1], [3, 0]],
    #%opt = ("legend",
    #["\xE4\xBC\x98", "\xE5\xB7\xAE", "\xE8\x89\xAF"],
    #"label",
    #["\xE7\x94\xB5\xE4\xBF\xA1", "\xE8\x81\x94\xE9\x80\x9A"], )
  

read_chart_data_dim3_horizon

    my ($r, %opt) = read_chart_data_dim3_horizon('03.dim3_horizon.csv', 
        skip_head=> 1, 
        label => [0], 
        legend => [1 .. 3], 
        names => [ qw/time good normal bad/ ], 
        sep=> ','
    );
    #$r = [[1, 4, 3, 7], [3, 2, 2, 9], [4, 2, 3, 8]],
    #%opt = ("legend",
    #["bad", "good", "normal"],
    #"label",
    #["2013-08-01", "2013-08-02", "2013-08-03", "2013-08-04"],)

read_chart_data_dim3_scatter

my ($r, %opt) = read_chart_data_dim3_scatter('04.dim3_scatter.csv', skip_head=> 1, label => [1], legend => [0], data => [2], label_sort => [ 1 .. 20 ], #legend_sort => [ '类', '型' ],

    sep=> ',', 
    charset => 'utf8', 
);

#( #[ #[ #[6, 11, 7, 9, 12, 8, 4, 3.5, 10], #[65, 105, 70, 80, 100, 60, 40, 45, 90], #], #[ #[6, 10.5, 12, 14, 15, 8, 10, 13, 16], #[80, 125, 125, 110, 150, 105, 130, 115, 170], #], #], #"legend", #["\x{578B}", "\x{7C7B}"], #"label", #[1 .. 20], #)




Hosting generously
sponsored by Bytemark