Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Strange behaviour for Metric Dot Chart

  1. #1

    Question Strange behaviour for Metric Dot Chart

    Hi Forks,

    I am working on a metric dot plot, and found the following strange behavior:

    If I passes more than 7 columns to the chart data, as seen below, the MetricDotChart tried to automatically create a series role and assign one column to it, it then messed up my mapping as shown below, see the dimensions and names are misaligned and highlighted in red, my options.dimensions and options.reader for this chart is:
    options.dimensions = {
    RISK_LEVEL: {valueType:String},
    PROBABILITY_OF_FAILURE: {valueType: Number},
    SEVERITY_VALUE: {valueType: Number, label:'Severity Value'},
    RISK_VALUE: {valueType: Number},
    RISK_SIZE: {valueType: Number},
    ASSET_RISK_ID: {valueType: Number},
    EXPENDITURE_DIM_ID: {valueType: Number},
    RISK_NAME: {valueType:String , isHidden:true},
    };

    options.readers = [
    {names: 'RISK_LEVEL', indexes: 0},
    {names: 'PROBABILITY_OF_FAILURE', indexes: 1 },
    {names: 'SEVERITY_VALUE', indexes: 2 },
    {names: 'RISK_VALUE', indexes: 3 },
    {names: 'RISK_SIZE', indexes: 4 },
    {names: 'ASSET_RISK_ID', indexes: 5 },
    {names: 'EXPENDITURE_DIM_ID', indexes: 6 },
    {names: 'RISK_NAME', indexes: 7 },
    ];

    [pvc.MetricDotChart ]: Creating pvc-d1.0.js:9050
    [pvc.MetricDotChart ]: DATA SOURCE SUMMARY
    ------------------------------------------
    ROWS (10/1000)
    [0] ["High", 0.33, 12000000, 3960000, 9, 8269, 0, "Safety"]
    [1] ["High", 0.33, 12000000, 3960000, 9, 10353, 43, "Environmental"]
    [2] ["High", 0.33, 12000000, 3960000, 9, 42339, 142, "Safety"]
    [3] ["High", 0.33, 12000000, 3960000, 9, 44448, 0, "Safety"]
    [4] ["High", 0.33, 12000000, 3960000, 9, 44414, 0, "Environmental"]
    [5] ["High", 0.33, 12000000, 3960000, 9, 10422, 43, "Safety"]
    [6] ["High", 0.32885, 12000000, 3946187.4833, 12, 43382, 191, "Safety"]
    [7] ["High", 0.32885, 12000000, 3946187.4833, 12, 31601, 190, "Environmental"]
    [8] ["High", 0.32885, 12000000, 3946187.4833, 12, 43446, 188, "Environmental"]
    [9] ["High", 0.32885, 12000000, 3946187.4833, 12, 43350, 191, "Environmental"]
    ...
    COLS (8)
    [0] 'RISK_LEVEL' (type: String, inspected: string)
    [1] 'PROBABILITY_OF_FAILURE' (type: String, inspected: number)
    [2] 'SEVERITY_VALUE' (type: String, inspected: number)
    [3] 'RISK_VALUE' (type: Numeric, inspected: number)
    [4] 'RISK_SIZE' (type: Numeric, inspected: number)
    [5] 'ASSET_RISK_ID ' (type: Numeric, inspected: number)
    [6] 'EXPENDITURE_DIM_ID' (type: Numeric, inspected: number)
    [7] 'RISK_TYPE' (type: String, inspected: string)
    pvc-d1.0.js:9563
    [pvc.MetricDotChart ]: Relational data source translator pvc-d1.0.js:9564
    [pvc.MetricDotChart ]: VIRTUAL ITEM ARRAY
    ------------------------------------------
    Index | Kind | Type | Name | Label > Dimension
    ------+------+--------+-------------------------+-------+------------------------
    0 | S | string | RISK_LEVEL | | RISK_LEVEL
    1 | C | number | SEVERITY_VALUE | | PROBABILITY_OF_FAILURE
    2 | M | number | PROBABILITY_OF_FAILURE | | SEVERITY_VALUE
    3 | M | number | SEVERITY_VALUE | | RISK_VALUE
    4 | M | number | RISK_VALUE | | RISK_SIZE
    5 | M | number | RISK_SIZE | | ASSET_RISK_ID
    6 | M | number | ASSET_RISK_ID | | EXPENDITURE_DIM_ID
    7 | M | number | EXPENDITURE_DIM_ID | | size

    pvc-d1.0.js:9568
    [pvc.MetricDotChart ]: VISUAL ROLES MAP SUMMARY
    ------------------------------------------
    VisualRole < Dimension(s)
    -----------+--------------
    multiChart | -
    dataPart | dataPart
    series | ASSET_RISK_ID
    color | RISK_LEVEL
    x | SEVERITY
    y | PROBABILITY
    size | size


    However, if I keep the number of columns down to 7, then everything works fine, no series role gets created and assigned, dimension and name as perfectly matched. see below log:

    [pvChart]: CCC RENDER pvc-d1.0.js:9186
    [pvc.MetricDotChart ]: Creating pvc-d1.0.js:9050
    [pvc.MetricDotChart ]: DATA SOURCE SUMMARY
    ------------------------------------------
    ROWS (10/1000)
    [0] ["High", 0.33, 12000000, 3960000, 9, 8269, 0]
    [1] ["High", 0.33, 12000000, 3960000, 9, 10353, 43]
    [2] ["High", 0.33, 12000000, 3960000, 9, 42339, 142]
    [3] ["High", 0.33, 12000000, 3960000, 9, 44448, 0]
    [4] ["High", 0.33, 12000000, 3960000, 9, 44414, 0]
    [5] ["High", 0.33, 12000000, 3960000, 9, 10422, 43]
    [6] ["High", 0.32885, 12000000, 3946187.4833, 12, 43382, 191]
    [7] ["High", 0.32885, 12000000, 3946187.4833, 12, 31601, 190]
    [8] ["High", 0.32885, 12000000, 3946187.4833, 12, 43446, 188]
    [9] ["High", 0.32885, 12000000, 3946187.4833, 12, 43350, 191]
    ...
    COLS (7)
    [0] 'RISK_LEVEL' (type: String, inspected: string)
    [1] 'PROBABILITY_OF_FAILURE' (type: String, inspected: number)
    [2] 'SEVERITY_VALUE' (type: String, inspected: number)
    [3] 'RISK_VALUE' (type: Numeric, inspected: number)
    [4] 'RISK_SIZE' (type: Numeric, inspected: number)
    [5] 'ASSET_RISK_ID ' (type: Numeric, inspected: number)
    [6] 'EXPENDITURE_DIM_ID' (type: Numeric, inspected: number)
    pvc-d1.0.js:9563
    [pvc.MetricDotChart ]: Relational data source translator pvc-d1.0.js:9564
    [pvc.MetricDotChart ]: VIRTUAL ITEM ARRAY
    ------------------------------------------
    Index | Kind | Type | Name | Label > Dimension
    ------+------+--------+-------------------------+-------+------------------------
    0 | C | string | RISK_LEVEL | | RISK_LEVEL
    1 | M | number | PROBABILITY_OF_FAILURE | | PROBABILITY_OF_FAILURE
    2 | M | number | SEVERITY_VALUE | | SEVERITY_VALUE
    3 | M | number | RISK_VALUE | | RISK_VALUE
    4 | M | number | RISK_SIZE | | RISK_SIZE
    5 | M | number | ASSET_RISK_ID | | ASSET_RISK_ID
    6 | M | number | EXPENDITURE_DIM_ID | | EXPENDITURE_DIM_ID

    pvc-d1.0.js:9568
    [pvc.MetricDotChart ]: VISUAL ROLES MAP SUMMARY
    ------------------------------------------
    VisualRole < Dimension(s)
    -----------+--------------
    multiChart | -
    dataPart | dataPart
    series | ASSET_RISK_ID
    color | RISK_LEVEL
    x | SEVERITY
    y | PROBABILITY
    size | -



    I really don't understand this behavior, as I would like to assign more dimensions/columns and would like them to be appear in the tooltips for drill down, but I got restricted to use max of 7 columns at the moment.

    Any help or comments would be really appreciated!

    Z
    Last edited by chenzhengbc; 03-24-2014 at 04:10 PM.

  2. #2
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi chenzhengbc,

    first of all, let me tell you that it's a real pleasure for me to see people using/understanding CCC.
    Specifically the data model and translation part, that confuses so many (certainly there are reasons for it!).

    We came across the same strange behavior a few days ago, but didn't yet have time to solve it. We did find a workaround, though, at least for our case.
    The problem seems to be not the number of columns, but the fact that a discrete (string) column is placed after the numeric/value columns.
    In our case, by placing all the string columns initially, and specifying the readers like you did, but with the new order, it worked.

    By the way, FYI, there's a shorter, nicer syntax for specifying readers, for cases where all the columns are contiguous.
    Your readers configuration could also be written like any of the following equivalent ways:
    Code:
    // A
    readers: [{names: ["RISK_LEVEL, PROBABILITY_OF_FAILURE", "SEVERITY_VALUE", "RISK_VALUE", "RISK_SIZE", "ASSET_RISK_ID", "EXPENDITURE_DIM_ID", "RISK_NAME"], indexes: [0, 1, 2, 3, 4, 5, 6, 7]}]
    
    // B - using a single string, separating column names using ","
    readers: [{names: "RISK_LEVEL, PROBABILITY_OF_FAILURE, SEVERITY_VALUE, RISK_VALUE, RISK_SIZE, ASSET_RISK_ID, EXPENDITURE_DIM_ID, RISK_NAME", indexes: [0, 1, 2, 3, 4, 5, 6, 7]}]
    
    // C - specifying only the starting index
    readers: [{names: "RISK_LEVEL, PROBABILITY_OF_FAILURE, SEVERITY_VALUE, RISK_VALUE, RISK_SIZE, ASSET_RISK_ID, EXPENDITURE_DIM_ID, RISK_NAME", indexes: [0]}]
    
    // D
    readers: [{names: "RISK_LEVEL, PROBABILITY_OF_FAILURE, SEVERITY_VALUE, RISK_VALUE, RISK_SIZE, ASSET_RISK_ID, EXPENDITURE_DIM_ID, RISK_NAME", indexes: 0}]
    
    // E - starts on first free index, but assuming you specified no other readers, it will be 0
    readers: [{names: "RISK_LEVEL, PROBABILITY_OF_FAILURE, SEVERITY_VALUE, RISK_VALUE, RISK_SIZE, ASSET_RISK_ID, EXPENDITURE_DIM_ID, RISK_NAME"}]
    
    // F - this is the simplest it gets
    readers: ["RISK_LEVEL, PROBABILITY_OF_FAILURE, SEVERITY_VALUE, RISK_VALUE, RISK_SIZE, ASSET_RISK_ID, EXPENDITURE_DIM_ID, RISK_NAME"]

  3. #3

    Default

    Hi duarte.leao,

    Thank you very much for the detail explanation on the syntax for readers, I am going to try them all out and observe the behaviors. It is a very comprehensive guidance you provided. Thanks!

    Zheng

  4. #4
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi,

    this has been fixed in master: http://jira.pentaho.com/browse/CDF-305.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.